Compare commits

...

1581 Commits

Author SHA1 Message Date
Loïc Guilloux
1b01a0636c
Fix #14362, 4b677e8256: Don't crash old scripts doing silly instantiation (#14394) 2025-07-17 13:30:33 +02:00
nikolas
bccbd64037
Fix: GL error typo (#14376) 2025-07-17 07:18:35 +01:00
Ivan Pravdin
434163aa31
Fix #14277: Aircraft can land when Zeppeliner in the runway (#14317) 2025-07-17 07:26:57 +02:00
translators
55605ae8f2 Update: Translations from eints
english (au): 1 change by krysclarke
catalan: 1 change by J0anJosep
portuguese: 8 changes by jcteotonio
2025-07-17 04:45:55 +00:00
Jonathan G Rennison
7f792e9c5f
Codefix: Spelling error in name of GetGRFStringTextStackParameters (#14447) 2025-07-16 09:21:25 -04:00
translators
6b6caa6fa8 Update: Translations from eints
chinese (traditional): 1 change by KogentaSan
greek: 1 change by gh658804
hungarian: 1 change by vargaviktor
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
catalan: 49 changes by J0anJosep
portuguese: 2 changes by jcteotonio
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by pAter-exe
2025-07-16 04:46:46 +00:00
Peter Nelson
67e56391c7
Fix #8167: No error sub-message when trying to clear protected buildings. (#14444) 2025-07-14 23:23:15 +01:00
Peter Nelson
e015e3ecc3
Codefix 3fde611012: AirportMovingDataFlag should be enum class (#14435)
`AirportMovingDataFlag` was changed to use `enum class` naming style, but wasn't actually changed to be `enum class`.
2025-07-14 23:22:51 +01:00
Henry Wilson
8330957a4d Codechange: Remove manual memory management from IcuStringIterator 2025-07-14 23:55:24 +02:00
Peter Nelson
9ce2aca949 Codechange: Get/pass ScriptStorage by reference instead of pointer. 2025-07-14 19:19:29 +01:00
Peter Nelson
55098a2f2e Codechange: Get/pass engine by reference instead of pointer. 2025-07-14 19:19:29 +01:00
Peter Nelson
7ff0c67f77 Codechange: Get/pass script controller by reference instead of pointer. 2025-07-14 19:19:29 +01:00
Peter Nelson
b2de1ff66f
Fix #14433: Broken road stop drawing due to incorrect modes conversion. (#14434)
The mask was treated as a single RoadStopDrawMode instead of a RoadStopDrawModes bitset.
2025-07-14 17:25:53 +01:00
Loïc Guilloux
fc924161ab
Fix 0455627d: Don't draw timetable panel if no orders (#14441) 2025-07-14 14:18:54 +00:00
Peter Nelson
61a299bc99
Codechange: Use SpriteID as GlyphID for SpriteFontCache. (#14439)
This reduces the amount of lookups in the character map as rendering a cached layout no longer needs to do so.
2025-07-14 13:28:10 +01:00
Peter Nelson
7546c1acab
Codefix f220ed179d: GetUnicodeGlyph takes a unicode character. (#14438)
Previous change erroneously changed type to GlyphID, based on naming. It should actually be char32_t.
2025-07-14 08:01:42 +00:00
Peter Nelson
a6143eea21
Codechange: Include more relevant headers for script_storage. (#14437) 2025-07-14 07:49:50 +01:00
Peter Nelson
1d38cbafcb Codechange: Use unique_ptr for ScriptInfo instances.
Replaces raw pointers, slightly.
2025-07-14 00:10:14 +01:00
Peter Nelson
992d58d799 Codechange: Pass ScriptInfo by reference to IsSameScript. 2025-07-14 00:10:14 +01:00
Peter Nelson
8f34b7a821 Codechange: Keep Squirrel engine in unique_ptr. 2025-07-14 00:10:14 +01:00
Peter Nelson
bf6d0c4934
Codechange: Don't pre-fill font metrics when loading fonts. (#14436)
Each font cache implementation sets its own metrics based on the loaded font, so there is no need to pre-fill with (unscaled, invalid) default metrics.
2025-07-13 23:38:31 +01:00
Michael Lutz
3c4fb21a5e
Fix: [Win32] Link failure with newer Windows SDK version due to WinRT changes. (#14432) 2025-07-13 22:34:32 +01:00
translators
baced00e9f Update: Translations from eints
spanish (mexican): 1 change by absay
english (us): 1 change by 2TallTyler
galician: 10 changes by pvillaverde
dutch: 1 change by Afoklala
portuguese: 10 changes by jcteotonio
2025-07-13 04:45:12 +00:00
translators
aaf5d39b15 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (traditional): 1 change by KogentaSan
chinese (simplified): 1 change by WenSimEHRP
korean: 1 change by telk5093
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-07-11 04:45:38 +00:00
Richard Wheeler
7db135099a
Fix: Scale graph gridlines and axes with GUI scale (#12131) 2025-07-10 00:05:48 +01:00
Peter Nelson
290144c5c9 Fix #14396: Industry production graph showed zero instead of N/A.
Record the number of valid history records per industry so that the graph avoids showing values which are not present as zero.
2025-07-09 23:02:58 +01:00
Peter Nelson
9b55ad5b8d Codechange: Generic type and container for history statistics. 2025-07-09 23:02:58 +01:00
Peter Nelson
f6e78a480d
Change: Make truncation ellipsis translatable. (#14417) 2025-07-09 22:55:43 +01:00
Tyler Trahan
259830777c
Fix #14375: When loading config, validate timekeeping mode and minutes per year (#14405) 2025-07-09 16:04:38 -04:00
Tyler Trahan
753905ae2d
Fix #14377: Make house picker window remember house protection state when closed (#14406) 2025-07-09 14:18:19 +00:00
Peter Nelson
d2ee2add28
Codechange: Remove ZOOM_LVL_GUI macro. (#14423) 2025-07-09 11:05:06 +01:00
translators
8de32c4509 Update: Translations from eints
portuguese: 7 changes by jcteotonio
2025-07-09 04:45:29 +00:00
Peter Nelson
77b572619a
Codechange: Make use of ZoomLevels range iteration. (#14422) 2025-07-08 14:00:12 +01:00
Peter Nelson
b21c8a3450
Codechange: Simplify test for bridges above bridge ramps. (#14421) 2025-07-08 13:55:36 +01:00
translators
6d86c760c6 Update: Translations from eints
hungarian: 9 changes by vargaviktor
2025-07-08 04:43:02 +00:00
translators
d44e693b25 Update: Translations from eints
norwegian (bokmal): 17 changes by eriksorngard
spanish (mexican): 6 changes by absay
english (us): 21 changes by 2TallTyler
2025-07-07 04:45:34 +00:00
translators
b0ea6c0974 Update: Translations from eints
chinese (traditional): 6 changes by KogentaSan
chinese (simplified): 6 changes by WenSimEHRP
2025-07-06 04:44:01 +00:00
Peter Nelson
84e9e106c1
Codefix: SpriteFontCache was never deleted. (#14414) 2025-07-05 13:22:45 +01:00
translators
ebd984d894 Update: Translations from eints
english (au): 3 changes by krysclarke
korean: 6 changes by telk5093
greek: 3 changes by gh658804
russian: 3 changes by Ln-Wolf
dutch: 6 changes by Afoklala
portuguese: 4 changes by jcteotonio
portuguese (brazilian): 3 changes by pasantoro
2025-07-05 04:43:09 +00:00
translators
f23845805a Update: Translations from eints
english (au): 6 changes by krysclarke
greek: 7 changes by gh658804
russian: 6 changes by Ln-Wolf
finnish: 25 changes by hpiirai
portuguese: 19 changes by jcteotonio
portuguese (brazilian): 6 changes by pasantoro
polish: 6 changes by pAter-exe
2025-07-04 04:42:38 +00:00
Loïc Guilloux
655291facb
Fix #14385: [Strgen] Don't count parameters more than one time (#14413) 2025-07-04 01:10:50 +02:00
Peter Nelson
16b0371c1b
Codechange: Remove owner from CargoPayment. (#14411)
Owner can instead be looked up from the CargoPayment's vehicle.

This reduces the size of each CargoPayment slightly.
2025-07-03 23:11:12 +01:00
Heikki Piirainen
febba930b0 Fix: Inconsistent capitalization in game settings 2025-07-03 17:11:51 +02:00
translators
bf07751ee7 Update: Translations from eints
spanish (mexican): 12 changes by absay
portuguese: 1 change by jcteotonio
2025-07-03 04:44:02 +00:00
Tyler Trahan
e578668a93
Fix #14360: Don't reuse strings for Low/Medium/High setting values (#14409) 2025-07-02 06:09:39 -04:00
translators
226b098c55 Update: Translations from eints
portuguese: 17 changes by jcteotonio
2025-07-02 04:42:46 +00:00
Peter Nelson
0391eec189
Change: Improve sprite ellipsis appearance. (#14404)
Make spacing more consistent with periods.
2025-07-01 17:34:26 +01:00
translators
b84b641ed9 Update: Translations from eints
hungarian: 7 changes by vargaviktor
2025-07-01 04:45:31 +00:00
Peter Nelson
4fe6adb2dd
Fix c2d4098afa: Crash when accessing unconfigurable badge feature. (#14403)
Some features support badges but do not have a way to configure them. Accessing these features could crash the game.
2025-06-30 21:45:08 +01:00
Peter Nelson
36d7e09369
Fix: Include sort button width in content list header minimal size. (#14402) 2025-06-30 20:40:26 +01:00
Peter Nelson
42a9d27fd9
Fix: Don't draw truncation ellipsis if it's too wide. (#14401) 2025-06-30 20:40:04 +01:00
Peter Nelson
80d2194511
Fix: Don't include ellipsis width in RTL truncation offset. (#14400)
This caused the right-most glyphs to be truncated.
2025-06-30 10:03:24 +01:00
translators
7c33a67e7b Update: Translations from eints
galician: 30 changes by pvillaverde
danish: 6 changes by bscargo
2025-06-30 04:44:29 +00:00
translators
9bcf1cf29b Update: Translations from eints
korean: 8 changes by telk5093
polish: 3 changes by pAter-exe
2025-06-29 04:45:43 +00:00
Peter Nelson
4b6d409ee8
Codefix: Out-of-range cargo type passed to a string affected remaining parameters. (#14398)
When the string codes CARGO_TINY, CARGO_SHORT or CARGO_LONG encountered an out-of-range string, they did not read the extra amount parameter. This leads to later parameters being used in the wrong place.

Change the order of operation so that all parameters for these string codes are always read, even if the cargo type is not valid.
2025-06-28 21:50:36 +01:00
translators
a37ad181ff Update: Translations from eints
dutch: 12 changes by Afoklala
polish: 12 changes by pAter-exe
2025-06-28 04:42:40 +00:00
Peter Nelson
20ed5be905
Codechange: Use FontSizeToName() instead of switch block. (#14395) 2025-06-27 20:38:39 +00:00
translators
f41ad372a3 Update: Translations from eints
chinese (traditional): 1 change by KogentaSan
2025-06-27 04:42:22 +00:00
Peter Nelson
bd2430dc94 Codechange: Use FlatSet to avoid trying to add variant parents multiple times. 2025-06-26 08:33:34 +01:00
Peter Nelson
1ddc03b916 Codechange: Give FlatSet insert() a return value.
This now returns an iterator, and whether an insert was performed.

Allows the caller to know if the item was already in the FlatSet without explicitly checking first.
2025-06-26 08:33:34 +01:00
translators
1ff12b6e74 Update: Translations from eints
english (au): 8 changes by krysclarke
chinese (traditional): 23 changes by KogentaSan
chinese (simplified): 12 changes by WenSimEHRP
greek: 8 changes by gh658804
russian: 6 changes by Ln-Wolf
finnish: 8 changes by hpiirai
portuguese: 9 changes by jcteotonio
portuguese (brazilian): 8 changes by pasantoro
2025-06-26 04:43:34 +00:00
Peter Nelson
d5ebd20110
Fix 319caef58f: Buildings with non-zero subtile offsets broken in house picker. (#14390)
Partially reverts 319caef58f. Conversion of subtile position was originally correct.
2025-06-25 17:33:15 +00:00
translators
b3c96a7785 Update: Translations from eints
english (au): 4 changes by krysclarke
norwegian (bokmal): 4 changes by eriksorngard
chinese (traditional): 4 changes by KogentaSan
korean: 4 changes by telk5093
greek: 4 changes by gh658804
hungarian: 4 changes by vargaviktor
russian: 4 changes by Ln-Wolf
finnish: 4 changes by hpiirai
portuguese: 4 changes by jcteotonio
portuguese (brazilian): 4 changes by pasantoro
2025-06-25 04:42:43 +00:00
Peter Nelson
8f01ae675e
Revert 0853c1979b: Button to toggle showing advanced signal types (#9617) (#14219) 2025-06-24 20:18:08 +02:00
Peter Nelson
a46a3a97f3
Change: New company face definition system and UI. (#14319)
Bits used by company faces are now defined by a variable system instead of being hardcoded, allowing future expansion.

The four face types covering gender and skin colour are now separate face styles with their own definitions.
2025-06-24 07:59:49 +01:00
translators
ebc74c8905 Update: Translations from eints 2025-06-24 04:43:09 +00:00
Jonathan G Rennison
e436b32468 Codechange: Remove now unused sprite cache memory error strings 2025-06-23 21:22:37 +01:00
Peter Nelson
7744f49a9e Change: Simplify sprite cache memory management
* Remove custom allocator
* Use std::unique_ptr for sprite data
* Perform LRU cache eviction in a single pass
2025-06-23 21:22:37 +01:00
Peter Nelson
1d67094863
Add: Buttons to change picker preview image height. (#14373)
Adjusted height is remembered per picker type, but not saved.
2025-06-23 08:24:49 +01:00
Peter Nelson
8901f9adca
Fix #14361: Removing a badge filter did not clear it. (#14379) 2025-06-23 08:24:03 +01:00
translators
c15568be5f Update: Translations from eints
ukrainian: 20 changes by StepanIvasyn
latvian: 13 changes by lexuslatvia
2025-06-22 04:43:50 +00:00
Patric Stout
3571f77d46
Codechange: typo in GoG's workflow (#14386) 2025-06-21 09:25:39 +00:00
dependabot[bot]
1b2a3b0cb1
Upgrade: Bump Apple-Actions/import-codesign-certs in the actions group (#13945)
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 3 to 5
- [Release notes](https://github.com/apple-actions/import-codesign-certs/releases)
- [Commits](https://github.com/apple-actions/import-codesign-certs/compare/v3...v5)

---
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>
2025-06-21 09:18:32 +00:00
Peter Nelson
5766ba51d7
Codefix: Clean up incorrect indentation for multi-line comments. (#14383) 2025-06-20 19:01:44 +01:00
translators
a927925996 Update: Translations from eints
portuguese: 13 changes by jcteotonio
2025-06-20 04:42:53 +00:00
translators
de6e420917 Update: Translations from eints
ukrainian: 11 changes by StepanIvasyn
portuguese: 18 changes by jcteotonio
2025-06-19 04:43:06 +00:00
Adam Zmuda
9238f508eb
Fix #14081: Check if removed item is a savegame (#14371) 2025-06-18 10:05:18 +02:00
translators
7aa4e7fc58 Update: Translations from eints
ukrainian: 12 changes by StepanIvasyn
portuguese: 8 changes by jcteotonio
2025-06-18 04:43:22 +00:00
Peter Nelson
c882ad5142
Fix: Allow object picker to resize if there are no classes. (#14372) 2025-06-17 19:04:34 +01:00
Peter Nelson
e4cf6ca0ba
Fix: Mis-sized widgets due to missing widget fill. (#14370)
In most places where we calculate and set widget resize step we neglect
to set widget fill step to match. Initial widget sizing uses fill step
instead of resize step, which means the initial size may not be a
multiple of the resize step as intended. In particular this will cause
WWT_MATRIX to be misrendered.

Whether or not this matters depends on the widget type being resized and
the window layout, however for consistency always set fill step to the
same as resize step when calculating.
2025-06-17 17:40:11 +01:00
Peter Nelson
4144865c73 Change: Tweak layout of music player widgets.
This removes some magic numbers and gets rid of spacers.
2025-06-17 08:54:08 +01:00
Peter Nelson
7ec78e94db Fix: Don't include height of blank text in frame and inset widgets. 2025-06-17 08:54:08 +01:00
translators
dd826ea49c Update: Translations from eints
spanish: 13 changes by Unely
portuguese: 30 changes by jcteotonio
2025-06-17 04:41:57 +00:00
Peter Nelson
009b68caeb
Codechange: Use toolbar minimal sizing with intro menu buttons. (#14368)
The intro menu buttons use toolbar icons, so use SetToolbarMinimalSize() on them for consistency.
2025-06-17 01:12:39 +01:00
Colin Caine
5f8e04457e
Codechange: Use default OnHotkey handler for focusing editboxes (#14358) 2025-06-16 22:25:54 +02:00
Henry
56bc391763
Codechange: Remove manual memory management of AIScannerInfo::info_dummy (#14338)
Co-authored-by: Henry Wilson <henry@henryandlizzy.uk>
2025-06-16 10:30:22 +01:00
translators
ea410cfe85 Update: Translations from eints
chinese (traditional): 4 changes by KogentaSan
chinese (simplified): 69 changes by WenSimEHRP
ukrainian: 57 changes by StepanIvasyn
portuguese: 35 changes by jcteotonio
2025-06-16 04:43:21 +00:00
Henry
c71515e790
Codechange: Remove manual memory management from CountArticulatedParts (#14336)
Co-authored-by: Henry Wilson <henry@henryandlizzy.uk>
2025-06-15 21:38:00 +01:00
Peter Nelson
cdd555edd5
Codechange: Use vector with unique_ptr instead of linked-list for base set lists. (#14332) 2025-06-15 21:32:29 +01:00
Michael Lutz
e163aab892
Fix: Train path reservations on different railtypes could join leading to train crashes. (#14366)
This could happen if the compatibility between the railtypes was not symmetric. If for
example a reservation of a first train ended at a railtype transition with an already present
reservation on the other side, a reversing train could end up crashing with the first train.
2025-06-15 22:09:04 +02:00
translators
98b488f366 Update: Translations from eints
chinese (traditional): 3 changes by KogentaSan
chinese (simplified): 108 changes by WenSimEHRP
ukrainian: 21 changes by StepanIvasyn
dutch: 9 changes by Afoklala
portuguese: 177 changes by jcteotonio
2025-06-15 04:42:32 +00:00
Loïc Guilloux
d0b56022d8
Fix #14362, 4b677e8256: Class with non static methods may have a default constructor (#14363) 2025-06-14 23:39:22 +02:00
Peter Nelson
1cd0391926
Fix #14356, ff7eb996e6: Incorrect sprite group chosen for stations and road stops. (#14359) 2025-06-14 13:38:45 +01:00
glx22
8e3acbfa84 Codechange: Deduplicate DefSQClass::DefSQ[Static]Method() 2025-06-14 12:41:39 +02:00
glx22
90e21bc713 Codechange: Remove useless SQConstruct parameters 2025-06-14 12:41:39 +02:00
glx22
4b677e8256 Codechange: Don't export default constructors 2025-06-14 12:41:39 +02:00
glx22
ccffbb4142 Codechange: Remove manual param count for constructors too 2025-06-14 12:41:39 +02:00
glx22
6d601e2eb1 Codechange: Use more descriptive variable names 2025-06-14 12:41:39 +02:00
translators
a1786fa1f4 Update: Translations from eints
norwegian (bokmal): 13 changes by eriksorngard
ukrainian: 28 changes by StepanIvasyn
portuguese: 16 changes by jcteotonio
polish: 1 change by pAter-exe
2025-06-13 04:42:21 +00:00
Jonathan G Rennison
d3e4e07daa Codechange: Remove ReferenceThroughBaseContainer 2025-06-12 18:50:49 +01:00
Jonathan G Rennison
63f1c2aa3a Codechange: Use TypedIndexContainer for typed index containers
Instead of ReferenceThroughBaseContainer
2025-06-12 18:50:49 +01:00
Jonathan G Rennison
d0e49a297f Codechange: Add TypedIndexContainer adapter type
This is equivalent in functionality to ReferenceThroughBaseContainer,
except only for the correct index type, instead of any type matching
ConvertibleThroughBase.
The also serves to unambiguously document the index type at the
point of definition of the container.
2025-06-12 18:50:49 +01:00
Peter Nelson
401ebed03a
Add: Show and sort online content version in list. (#14355) 2025-06-12 18:27:16 +01:00
translators
b012d9e3dc Update: Translations from eints
danish: 18 changes by bscargo
portuguese: 23 changes by jcteotonio
2025-06-12 04:42:39 +00:00
Peter Nelson
28cc0079f2
Codechange: Create ScriptAllocator with make_unique instead of new. (#14340) 2025-06-11 23:28:08 +01:00
Peter Nelson
b2d69ae606
Codechange: Use AutoRelease to simplify cleanup after FontConfig calls. (#14354) 2025-06-11 21:24:31 +01:00
Peter Nelson
9c16603da6
Codechange: Add AutoRelease helper to use function as unique_ptr deleter. (#14353)
This allows passing the function as a template parameter instead of requiring a custom deleter functor.
2025-06-11 20:13:49 +01:00
translators
f8776b0a6f Update: Translations from eints
hungarian: 9 changes by vargaviktor
finnish: 13 changes by hpiirai
ukrainian: 1 change by imlystyi
tamil: 2 changes by merni-ns
lithuanian: 1 change by khamper
spanish: 22 changes by Unely
portuguese: 46 changes by jcteotonio
2025-06-11 04:42:30 +00:00
Peter Nelson
f2318c35db
Fix 0455627d16: Order backups were no longer created when selling vehicles. (#14352) 2025-06-10 18:03:05 +01:00
Peter Nelson
c702e05517
Codechange: Replace C-casts for FontConfig with helper functions. (#14349)
Add `ToFcString()` and `FromFcString()` to remove C-style casts and make reinterpret_casts safer and clearer.
2025-06-10 17:11:22 +01:00
Peter Nelson
8f5ac84a3d
Fix 20738865f0: Remove colour codes from Game Options strings. (#14348)
When merging the game options and settings windows, colour codes were removed from strings. This change didn't get propagated to all translations.
2025-06-10 17:10:57 +01:00
translators
8c90be8c9f Update: Translations from eints
english (au): 9 changes by krysclarke
spanish (mexican): 10 changes by absay
english (us): 9 changes by 2TallTyler
korean: 13 changes by telk5093
lithuanian: 3 changes by khamper
portuguese: 13 changes by jcteotonio
polish: 9 changes by pAter-exe
2025-06-10 04:42:12 +00:00
Peter Nelson
4f18c18735
Fix: Remove U+200C characters from Lithuanian translation. (#14347)
This character prevents OpenTTD Sans being used.
2025-06-09 11:53:31 +00:00
translators
3908df5fbe Update: Translations from eints
chinese (traditional): 9 changes by KogentaSan
greek: 9 changes by gh658804
russian: 9 changes by Ln-Wolf
portuguese (brazilian): 9 changes by pasantoro
2025-06-09 04:43:26 +00:00
SamuXarick
ac8b236885
Fix: [Script] Make ScriptOrder functions aware of road waypoints (#13419) 2025-06-08 16:49:36 -04:00
SamuXarick
484f18f987
Codechange: Code style changes to AI/GS GUI files (#13665) 2025-06-08 16:48:36 -04:00
SamuXarick
893a75f2c0
Codechange: Iterate with VehiclesOnTile when attaching a just bought wagon to a locomotive (#14284) 2025-06-08 16:45:58 -04:00
Peter Nelson
de660cba02
Change: Consistent toolbar sizes with dedicated NWidgetParts. (#14344)
Add SetToolbarSpacerMinimalSize() and SetToolbarMinimalSize() NWidgetParts and use to make toolbar button sizes consistent.
2025-06-08 18:13:47 +00:00
Peter Nelson
7c9c2aec49
Codechange: Use vehicle tile hash to search for free wagons. (#14343)
Avoids iterating the vehicle pool.
2025-06-08 19:07:43 +01:00
translators
4b18622c4e Update: Translations from eints
chinese (traditional): 4 changes by KogentaSan
english (us): 4 changes by 2TallTyler
french: 4 changes by ottdfevr
2025-06-08 04:43:18 +00:00
Peter Nelson
2f725d1e85 Add: Hover on graph legend to highlight line. 2025-06-07 15:50:25 +01:00
Peter Nelson
10841ea3fd Codechange: Add constant for common blink interval. 2025-06-07 15:50:25 +01:00
Peter Nelson
ecafbf884e
Add: Allow separate expansion of town buildings and roads in scenario editor. (#14341) 2025-06-07 13:56:43 +00:00
translators
6b5cde463a Update: Translations from eints
english (au): 4 changes by krysclarke
spanish (mexican): 3 changes by absay
greek: 4 changes by gh658804
hungarian: 4 changes by vargaviktor
russian: 5 changes by Ln-Wolf
dutch: 4 changes by Afoklala
portuguese (brazilian): 4 changes by pasantoro
polish: 4 changes by pAter-exe
2025-06-07 04:40:06 +00:00
Loïc Guilloux
9339b8270c
Fix: Wrong error message about script Save() returned value (#14334) 2025-06-06 19:01:50 +02:00
Peter Nelson
a6de925ba6
Fix #14333, 20d83677eb: Incorrect change from index to range iteration. (#14335) 2025-06-06 16:57:26 +00:00
glx22
938acbe6ef Add: [Script] Cloning ScriptList 2025-06-05 22:37:33 +02:00
glx22
7200e7f509 Add: [Script] Framework for cloning selected ScriptObject 2025-06-05 22:37:33 +02:00
Jonathan G Rennison
7dcc932d44
Fix: Drag drop line position when dragging NewGRF from file to active panel (#14316) 2025-06-05 14:09:51 -04:00
Peter Nelson
48764b0fed Add: Badge dropdown filters to picker window. 2025-06-05 17:55:24 +01:00
Peter Nelson
7b60e5ccad Add: Badge dropdown filters to build vehicle window. 2025-06-05 17:55:24 +01:00
Peter Nelson
25f1c97bea Change: Add badge dropdown filters and configuration. 2025-06-05 17:55:24 +01:00
Peter Nelson
308ce39747 Codechange: Add DropDownUnselectable component.
This component makes a drop down item unselectable, as it says on the tin.
2025-06-05 17:55:24 +01:00
Peter Nelson
82f5af7ecd Codechange: Allow all widget types to have a WidgetID index. 2025-06-05 17:55:24 +01:00
glx22
31fbb17c5b Codechange: Replace ScriptObject::[SG]etAllowDoCommand with ScriptObject::DisableDoCommandScope 2025-06-05 01:39:40 +02:00
glx22
4beb23af30 Codechange: TicToc can now accumulate and output every tick 2025-06-04 23:59:06 +02:00
glx22
fca75fd06a Codechange: Use brace counting to detect end of class in squirrel-exporter 2025-06-04 19:48:27 +02:00
glx22
6482e16564 Codechange: Deduplicate namespace opening in squirrel-exporter 2025-06-04 19:48:27 +02:00
glx22
e0d8158957 Codechange: Don't use literal tabs in squirrel-exporter 2025-06-04 19:48:27 +02:00
Owen Rudge
b0dbe631b3 Codechange: [CI] Azure Code Signing has been rebranded 'Trusted Signing' 2025-06-04 09:16:18 +01:00
Peter Nelson
2e78c24ba3
Codefix: Use bitset .None() or .Any() instead of comparing against an empty bitset. (#14327) 2025-06-04 07:31:44 +01:00
translators
8f10f9fb5a Update: Translations from eints
finnish: 1 change by hpiirai
2025-06-04 04:43:00 +00:00
Peter Nelson
5bf31a431e
Fix 4c8f1b0f81: Hidden-by-facility station signs were not ignored when handling clicks. (#14326) 2025-06-03 20:53:53 +00:00
Loïc Guilloux
9e8fc8da48
Fix: [Script] SQOpsLimiter had no effect for native valuator/filter (#14322) 2025-06-03 14:05:29 +02:00
Peter Nelson
ea0b3983a5 Codechange: Deduplicate common parts of graph windows with cargo legends.
This unifies handling on the cargo selected to avoid having to rewrite it for every cargo graph window.
2025-06-02 17:40:39 +01:00
Peter Nelson
43d57a6b7e Codefix 5c45738613: Rename CompanyGraphWindow to BaseCompanyGraphWindow.
This makes it clearer that it isn't a final graph window.
2025-06-02 17:40:39 +01:00
translators
6d0dd90e20 Update: Translations from eints
korean: 2 changes by telk5093
portuguese: 2 changes by jcteotonio
2025-06-02 04:43:26 +00:00
Peter Nelson
b7b2b57805
Fix bd1a3fe0b7: Crash if loading compatibility scripts fails. (#14318) 2025-05-31 19:59:23 +01:00
Peter Nelson
4ab48f34f5
Fix 5664b1e2f6: Upgrade button in NewGRF window no longer worked. (#14315) 2025-05-31 08:20:55 +00:00
translators
621c031307 Update: Translations from eints
dutch: 4 changes by Afoklala
2025-05-31 04:39:26 +00:00
Loïc Guilloux
2cd3c8db86
Codechange: [Script] Don't report multiple errors on valuator/filter failure (#14303) 2025-05-30 14:38:41 +02:00
translators
10c159a79f Update: Translations from eints
norwegian (bokmal): 4 changes by eriksorngard
korean: 4 changes by telk5093
2025-05-29 04:47:48 +00:00
Peter Nelson
c233e5ee2c Codechange: Tweak layouts of graph windows to reduce spacers. 2025-05-28 18:40:33 +01:00
Peter Nelson
5c45738613 Codechange: Improve inheritance of graph windows.
BaseGraphWindow contains parts that are only relevant to company-series data -- these are moved to a separate class.
2025-05-28 18:40:33 +01:00
translators
3aca5d62a8 Update: Translations from eints
spanish (mexican): 4 changes by absay
chinese (simplified): 4 changes by WenSimEHRP
hungarian: 5 changes by vargaviktor
french: 27 changes by glx22
polish: 4 changes by pAter-exe
2025-05-28 04:47:09 +00:00
Peter Nelson
7c9393e822
Codechange: Remove terminator from airport tile lists. (#14306) 2025-05-27 20:23:59 +01:00
translators
808af15975 Update: Translations from eints
english (au): 4 changes by krysclarke
chinese (traditional): 5 changes by KogentaSan
english (us): 5 changes by 2TallTyler
greek: 4 changes by gh658804
russian: 4 changes by Ln-Wolf
finnish: 4 changes by hpiirai
latvian: 6 changes by lexuslatvia
portuguese: 4 changes by jcteotonio
portuguese (brazilian): 4 changes by pasantoro
2025-05-27 04:48:27 +00:00
Peter Nelson
e2d066e5d3
Codefix: Effect vehicles don't use v->tile, so shouldn't be in the vehicle tile hash. (#14302) 2025-05-26 21:45:46 +01:00
translators
e23a591a1e Update: Translations from eints
galician: 10 changes by pvillaverde
turkish: 20 changes by BeratSJ
latvian: 2 changes by lexuslatvia
2025-05-26 04:49:25 +00:00
Peter Nelson
b042e7a439
Codefix: Prefer static inline const keyword order. (#14301) 2025-05-25 20:32:56 +01:00
Peter Nelson
948ceb3b17 Add: Button to configure badges in build picker window. 2025-05-25 09:13:05 +01:00
Peter Nelson
f28dc3cca4 Add: Button to configure badges in build vehicle window. 2025-05-25 09:13:05 +01:00
Peter Nelson
c2d4098afa Add: Configuration of NewGRF badges. 2025-05-25 09:13:05 +01:00
Peter Nelson
daef052329 Add: Generic "configure list/view" vertical ellipsis icon. 2025-05-25 09:13:05 +01:00
Peter Nelson
29970fb496 Codechange: Add DropDownToggle component. 2025-05-25 09:13:05 +01:00
Peter Nelson
6e90b828c6 Codechange: Add CentreTo Rect method. 2025-05-25 09:13:05 +01:00
Peter Nelson
c213218b66 Codechange: Pass click state to Dropdown Draw() function.
This allows drawing to change depending on last click position.
2025-05-25 09:13:05 +01:00
Peter Nelson
984d864c72 Codechange: Add OnClick handler for dropdown items.
This allows each dropdown item to indicate if something different should happen depending on where in the item was clicked.
2025-05-25 09:13:05 +01:00
Peter Nelson
04e07dff84 Codechange: Add Up/Down buttons, to fit in with the settings-button style. 2025-05-25 09:13:05 +01:00
translators
b82e32c360 Update: Translations from eints
norwegian (bokmal): 1 change by eriksorngard
spanish (mexican): 1 change by absay
chinese (simplified): 1 change by WenSimEHRP
korean: 1 change by telk5093
danish: 68 changes by bscargo
2025-05-25 04:48:20 +00:00
Loïc Guilloux
5e765a2787
Codechange: [CMake] Use ".sq.hpp" instead of ".hpp.sq" for API exports (#14297) 2025-05-24 22:38:37 +02:00
Kuhnovic
34c0b09764
Codechange: Removed T prefix from water region related types. (#14290) 2025-05-24 18:12:16 +02:00
Loïc Guilloux
fea120a710
Fix #14295, 0455627d16: v->cur_implicit_order_index is never INVALID_VEH_ORDER_ID (#14296) 2025-05-24 13:53:51 +00:00
translators
c366e6a48e Update: Translations from eints
chinese (simplified): 1 change by WenSimEHRP
dutch: 1 change by Afoklala
2025-05-24 04:44:57 +00:00
Peter Nelson
b42abfbefc
Fix 0455627d16: Incorrect script order position mapping. (#14294) 2025-05-23 19:55:22 +01:00
Kuhnovic
180ec6505b
Codechange: Use strong types for water regions. (#14289) 2025-05-23 20:54:42 +02:00
Peter Nelson
0455627d16
Codechange: Move ownership of Orders to OrderList. (#13948)
Removes the orders pool, and orders are now stored directly in each OrderList.

Iterating orders now no longer needs to traverse a linked-list, all orders in an OrderList are sequential.
2025-05-23 10:36:28 +01:00
Peter Nelson
7344dfe651 Change: Reflow Textfile window content incrementally.
This avoids a stall when reflowing a long text file with some truetype fonts.
2025-05-23 07:42:10 +01:00
Peter Nelson
46b745a06a Codechange: Use a helper method to test if text file window is wrapped. 2025-05-23 07:42:10 +01:00
Peter Nelson
940071a5f2 Codechange: Add alternating iterator to take elements from middle of range. 2025-05-23 07:42:10 +01:00
Peter Nelson
780c26237f Codechange: Add OnScrollbarScroll window event, called when a scrollbar position changes. 2025-05-23 07:42:10 +01:00
translators
321f7e8683 Update: Translations from eints
swedish: 3 changes by joeax910
2025-05-23 04:45:57 +00:00
Peter Nelson
1064309ecf
Change: Don't measure group name widths in company livery window. (#14291)
Measuring the name width did not also take account of indentation levels so didn't prevent cropping, and the window can be resized anyway.

This avoids a potential bottleneck due to layouting group names if there are a lot of groups present.
2025-05-22 22:57:50 +01:00
SamuXarick
5fef32bde7
Change: [Script] Move GSStation::GetOwner to GSBaseStation::GetOwner (#13406)
* Add: [Script] GSBaseStation::GetOwner

Added method for Game Scripts to retrieve the owner of a basestation.

* Cleanup: [Script] Remove ScriptStation::GetOwner

Due to class inheritance, GSStation::GetOwner and GSWaypoint::GetOwner can both reach GetOwner defined at GSBaseStation.
2025-05-22 13:47:04 +02:00
translators
467f832c2f Update: Translations from eints
english (au): 1 change by krysclarke
chinese (traditional): 10 changes by KogentaSan
greek: 1 change by gh658804
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
latvian: 1 change by lexuslatvia
portuguese: 1 change by jcteotonio
portuguese (brazilian): 1 change by pasantoro
polish: 10 changes by pAter-exe
2025-05-22 04:47:11 +00:00
Peter Nelson
5fe6578f64
Codechange: Improve performance of exclusive preview engine test. (#14270)
Check group statistics to test if a company has built an exclusive preview engine.

This improves performance by avoiding iterating the vehicle pool.
2025-05-21 21:19:38 +01:00
Peter Nelson
9f190aa534 Codechange: Use group's children list to improve performance of group UI. 2025-05-21 19:50:07 +01:00
Peter Nelson
000a79c093 Codechange: Improve performance of evaluating group hierarchy.
Store a list of child groups in each group, to avoid having to iterate the group pool to find its children.
2025-05-21 19:50:07 +01:00
SamuXarick
8f3f25de4b
Codefix: Missing 'this->' in VehiclesNearTileXY::Iterator::Iterator (#14288) 2025-05-21 20:28:47 +02:00
Peter Nelson
1d8db2223f
Fix #14234, 5aa4ad5135: Crash due to unexpected NUL char in string. (#14235)
Gracefully handle an unexpected NUL character in non-debug builds.
2025-05-21 18:47:04 +01:00
translators
82876c25e0 Update: Translations from eints 2025-05-21 04:46:46 +00:00
Peter Nelson
a2addf0fe7
Fix: Clear rail vehicle flipped flag if reverse probability callback returns false. (#14281)
This now distinguishes between not-flipped and callback not implemented.
2025-05-20 23:03:55 +01:00
Peter Nelson
acf594a7b7
Fix #14271, 7fd0e6c27d: Crash due to incorrect parameter index in string. (#14272) 2025-05-20 23:03:27 +01:00
Loïc Guilloux
4b1b2a4310
Change: [Script] Don't allow scripts to instantiate ScriptEvent (#14276) 2025-05-20 15:37:05 +02:00
frosch
2926179d02 Fix: Restore the behaviour when entering numbers in query windows: clamp integers out of range to the maximum valid value. 2025-05-20 12:57:30 +02:00
frosch
c1389c77b2 Codechange: ParseInteger optionally clamps out-of-range values, instead of treating them as invalid. 2025-05-20 12:57:30 +02:00
translators
ecadf1b322 Update: Translations from eints
hungarian: 4 changes by meskobalazs
2025-05-20 04:46:13 +00:00
Peter Nelson
ce83f583bc
Codechange: Use EnumBitSet for VehicleRailFlags. (#14280) 2025-05-19 18:56:45 +01:00
Peter Nelson
77d6f6c69f
Codechange: Make ContentType::State an enum class. (#14279) 2025-05-19 17:11:28 +01:00
SamuXarick
ad3a34e9ef
Add: [Script] ScriptVehicleList_Waypoint (#13456)
Creates a list of vehicles that have orders to a given waypoint.
2025-05-19 14:48:17 +02:00
Loïc Guilloux
1b0fd0e6fd
Fix b2c57123: [Script] Conversion from ScriptEvent to ScriptEventCompanyTown subclasses (#14274) 2025-05-18 15:40:47 +02:00
translators
9bbc525e53 Update: Translations from eints
catalan: 17 changes by J0anJosep
2025-05-18 04:50:09 +00:00
Peter Nelson
940a7127f8
Fix f8bdc1e612: Empty first parameter of EncodedString was skipped. (#14273)
This would place the remaining parameters one position too early.
2025-05-17 22:55:48 +00:00
translators
617169c1c9 Update: Translations from eints
norwegian (bokmal): 2 changes by eriksorngard
english (us): 9 changes by 2TallTyler
romanian: 3 changes by The-Bober
dutch: 2 changes by Afoklala
2025-05-17 04:44:32 +00:00
translators
521d0465d9 Update: Translations from eints
korean: 2 changes by telk5093
hungarian: 26 changes by meskobalazs
2025-05-16 04:47:27 +00:00
translators
6c84dd1f32 Update: Translations from eints
persian: 371 changes by realsepehrz
romanian: 49 changes by The-Bober
portuguese: 2 changes by azulcosta
2025-05-15 04:46:38 +00:00
Peter Nelson
c8a336f760 Codechange: Move GetNthSetBit() to BaseBitSet.
This now returns the correct type, or std::nullopt instead of -1.
2025-05-14 07:22:12 +01:00
Peter Nelson
c50ee282f9 Codechange: EnumBitSet bits can be iterated directly. 2025-05-14 07:22:12 +01:00
Peter Nelson
66c16a1d1f Codechange: Add Count() method to BaseBitSet. 2025-05-14 07:22:12 +01:00
translators
ecc3438519 Update: Translations from eints
polish: 2 changes by pAter-exe
2025-05-14 04:46:05 +00:00
Loïc Guilloux
c16d5f3a8d
Change: [Script] ScriptVehicleList_Station accepts an optional VehicleType parameter (#14260) 2025-05-13 16:41:23 +02:00
Peter Nelson
87fa1e41d5 Codechange: Use std::byte for sound buffers. 2025-05-13 14:51:17 +01:00
Peter Nelson
5585363407 Codechange: Use std::byte for glyph sprite buffer. 2025-05-13 14:51:17 +01:00
translators
c718858999 Update: Translations from eints
english (au): 2 changes by krysclarke
chinese (traditional): 2 changes by KogentaSan
spanish (mexican): 2 changes by absay
chinese (simplified): 11 changes by WenSimEHRP
greek: 2 changes by gh658804
hungarian: 2 changes by vargaviktor
persian: 17 changes by realsepehrz
russian: 2 changes by lexuslatvia
finnish: 4 changes by hpiirai
latvian: 2 changes by lexuslatvia
portuguese (brazilian): 2 changes by pasantoro
2025-05-13 04:47:36 +00:00
Peter Nelson
156f98ba06
Fix #14256, dfd9fbf873: Company finance windows not updated when paused. (#14258)
Refresh company finance windows via a WindowTimer instead of in game loop.

As the invalidation affects multiple windows this is a global timer instead of window-specific.
2025-05-13 01:23:27 +01:00
Peter Nelson
bc778545b3
Fix 0829604b4f: Dragging of selected order was still not possible. (#14259)
Check click_count condition earlier so that drag and drop is activated.
2025-05-13 01:22:58 +01:00
Peter Nelson
431e57d087
Fix 0ce30d05c8: Replacing a dropdown list could reposition it partially off-screen. (#14261) 2025-05-13 01:22:45 +01:00
Peter Nelson
d37d4c18b5
Change: Remove Apply button from NewGRF config window when unneeded. (#14254)
When configuring NewGRFs outside of a game, the changes are always applied when the window is closed, even if the Apply button is not used.

The Apply button only needs appear during a game when changes are not automatically applied.
2025-05-13 01:22:23 +01:00
Jonathan G Rennison
d107b7c8c0 Fix 3cf9b159: Incorrect tile colour in smallmap for snowy MP_CLEAR tiles in vegetation mode
See: #13659
2025-05-12 19:04:43 +02:00
Peter Nelson
d9247fa1a0
Change: Remove extra close buttons from some windows. (#14124)
All windows have an X button to close it, so remove the redundant close buttons.
2025-05-12 14:54:44 +01:00
frosch
a62081d79e
Fix #14251: Out-of-bounds writes via TextRefStack. (#14255) 2025-05-12 13:59:33 +02:00
Peter Nelson
0aacd7acb3
Codechange: Use GrfSpecFeature type instead of uint8_t. (#14253) 2025-05-12 08:44:39 +01:00
translators
2516c435b7 Update: Translations from eints
swedish: 9 changes by joeax910
2025-05-12 04:47:40 +00:00
Rubidium
568b70e556 Codechange: replace memmove with std::move(_backwards) 2025-05-11 21:51:57 +02:00
Rubidium
3cd040ffe9 Codechange: unify moving of pixels in the blitters 2025-05-11 21:51:57 +02:00
Peter Nelson
b38527ca05
Change: Move OpenTTD version to intro viewport. (#14233)
This stops the length of the game version from affecting the main menu.
2025-05-11 20:01:22 +01:00
Rubidium
03116ea878 Codechange: remove now unused cpp_sizeof 2025-05-11 13:48:23 +02:00
Rubidium
02d8ae018c Codechange: simplify getting the value of a NewGRF property 2025-05-11 13:48:23 +02:00
Rubidium
f2b48bad79 Codechange: remove last (hidden) users of memset 2025-05-11 06:07:01 +02:00
frosch
c037722cb5
Fix 51a7edd: NewGRF debug sprite picker was broken. (#14246) 2025-05-10 20:27:43 +02:00
Rubidium
a48a5f0cc6 Codechange: replace memcpy with std::copy_n 2025-05-10 16:50:58 +02:00
Loïc Guilloux
a45f23686d
Fix #14241, 6e10584: Invalid string parameters in subsidies list window (#14243) 2025-05-09 18:08:17 +02:00
Rubidium
f8aceb6c37 Codechange: use value initialisation over memset 2025-05-09 17:20:41 +02:00
Rubidium
7981fcb297 Codechange: use std::fill_n over memset 2025-05-09 17:20:41 +02:00
Rubidium
92bd78dd25 Codechange: use std::ranges::fill over memset 2025-05-09 17:20:41 +02:00
Rubidium
96873dee63 Codechange: use std::array.fill over memset 2025-05-09 17:20:41 +02:00
frosch
228f9ca941
Fix #13854: 40bpp-anim blitter recolouring failed for 32bpp pixels without mask channel. (#14242) 2025-05-09 17:16:29 +02:00
frosch
a277cb2b4c Change: [NewGRF] Increase the textstack for all callbacks to 16 registers. 2025-05-09 12:39:11 +02:00
frosch
c6fa5022cb Add: [NewGRF] All callbacks returning D0xx strings, have now the option to return any string id via register 0x100. 2025-05-09 12:39:11 +02:00
frosch
84bc78fd8f Add: [NewGRF] Special value 0x7FFE for VarAction2 results specifying 'return calculated result'. 2025-05-09 12:38:58 +02:00
frosch
9d32087236 Add: [NewGRF] Special value 0x7FFF for Action2 references specifying explicit 'callback/sprite-resolving failed'. 2025-05-09 12:38:58 +02:00
translators
b1cdf5024f Update: Translations from eints
spanish (mexican): 7 changes by absay
2025-05-09 04:46:47 +00:00
Peter Nelson
ae1f469aac
Fix #14234, 16b4e73: Skip PLURAL data if parameter is invalid. (#14236) 2025-05-08 09:06:56 +01:00
glx22
1d18b4a80b Codechange: remove core/mem_func.hpp 2025-05-08 09:33:18 +02:00
glx22
aba5e1258e Codechange: use assignment over MemCpyT 2025-05-08 09:33:18 +02:00
glx22
6356311fbc Codechange: use std::copy_n over MemCpyT 2025-05-08 09:33:18 +02:00
glx22
a013f81120 Codechange: use std::array's fill over memset 2025-05-08 09:33:18 +02:00
glx22
82244779eb Codechange: use C++ initialisation over MemSetT 2025-05-08 09:33:18 +02:00
translators
6680169251 Update: Translations from eints 2025-05-08 04:46:44 +00:00
Peter Nelson
2feba80fd7 Codechange: Codestyle fixes for elrail code. 2025-05-07 20:34:33 +01:00
Peter Nelson
4a8dd494ee Codechange: Don't abbreviate TileLocationGroup type name. 2025-05-07 20:34:33 +01:00
frosch
d00196cd65 Change: Rearrange buttons in the intro screen, remove unnecessary ones. 2025-05-07 18:41:48 +02:00
frosch
4111ce2698 Add: WWT_IMGTEXTBTN, WWT_PUSHIMGTEXTBTN 2025-05-07 18:41:48 +02:00
Peter Nelson
a7019b859c Codechange: Use DiagDirections when checking for flat buildable tiles. 2025-05-07 17:31:29 +01:00
Peter Nelson
aa9e5b38cd Codechange: Use DiagDirections when drawing level crossings. 2025-05-07 17:31:29 +01:00
Peter Nelson
1ac9f24f38 Codechange: Use (Diag)Directions when drawing catenary. 2025-05-07 17:31:29 +01:00
Peter Nelson
87544eff0c Codechange: Use DiagDirections to collect rail fence data. 2025-05-07 17:31:29 +01:00
Peter Nelson
1cbc4da054 Codechange: Use Directions for water flooding data. 2025-05-07 17:31:29 +01:00
Peter Nelson
968bb8961e Codechange: Add Directions and DiagDirections EnumBitSets. 2025-05-07 17:31:29 +01:00
Peter Nelson
e0dbbbb032 Codechange: Add Reset() and missing &=/|= operators for BaseBitSet. 2025-05-07 17:31:29 +01:00
Peter Nelson
c4d033967b
Codechange: Remove some unnecessary includes from network files. (#14226) 2025-05-07 16:46:14 +01:00
frosch
22fedca77e Codechange: Integrate ResolverObject::ResetState() into DoResolve(), no need to call it manually. 2025-05-06 22:24:41 +02:00
frosch
f8c928ed98 Codechange: Make temporary storage a member of ResolverObject. 2025-05-06 22:24:41 +02:00
frosch
eb9bbb2456 Codechange: Remove direct access to temporary storage from TextRefStack. 2025-05-06 22:24:41 +02:00
frosch
6faa667644 Codechange: Remove global GetRegister(), instead return 100+ registers directly from GetXxxCallback(). 2025-05-06 22:24:41 +02:00
frosch
f59cf73b88 Codechange: Access temporary storage through ResolverObject during sprite layout preprocessing. 2025-05-06 22:24:41 +02:00
frosch
85be7a4d92 Codechange: Access temporary storage through ResolverObject during Resolve. 2025-05-06 22:24:41 +02:00
frosch
99d7a775ad Codechange: Make GetRegister return a signed integer, matching the underlying TemporaryStorageArray. 2025-05-06 22:24:41 +02:00
frosch
74030a63e6 Codechange: Move SpriteLayoutProcessor's operations closer to the ResolverObject. 2025-05-06 22:24:41 +02:00
Rubidium
0ffdc86a2c Codechange: use std::ranges::equal over memcmp 2025-05-06 21:29:21 +02:00
Rubidium
89deb3876f Codechange: use fstream to compare file equality 2025-05-06 21:29:21 +02:00
frosch
cd7ac64f9d
Codefix: Fix compilation with DEBUG_DUMP_COMMANDS. (#14228) 2025-05-06 21:11:30 +02:00
frosch
592cc49b62 Codechange: Turn _grow_town_result into a local variable in GrowTownAtRoad. 2025-05-06 20:58:17 +02:00
frosch
5af877d12d Codechange: Do not assign _grow_town_result in GrowTownInTile, instead return the new value. 2025-05-06 20:58:17 +02:00
frosch
22af391064 Codechange: Move _grow_town_result out of GrowTownWithExtraHouse, GrowTownWithRoad, GrowTownWithBridge and GrowTownWithTunnel. 2025-05-06 20:58:17 +02:00
Rubidium
d70aeb72a7 Codechange: C++ initialise LanguageHeaderPack 2025-05-06 20:03:35 +02:00
Rubidium
8f1e94c546 Codechange: use C++ initialisation over MemSetT 2025-05-06 20:03:35 +02:00
Rubidium
cc51b29234 Codechange: use std::fill_n/copy_n over MemSetT/MemCpyT 2025-05-06 20:03:35 +02:00
Rubidium
0d922c9d62 Codechange: use std::array's fill over memset 2025-05-06 20:03:35 +02:00
Rubidium
4c1cd4fe4c Codefix: remove unused mem_func includes 2025-05-06 20:03:35 +02:00
Peter Nelson
9735fbbaa1 Codechange: Use LRUCache for layouted LineCache.
This avoids needing to manually manage the size of the cache.
2025-05-06 18:09:00 +01:00
Peter Nelson
8c4f8af66e Codechange: Move std::unique_ptr out of LRUCache implementation.
This is an implementation detail of how OpenGLSprites are stored.
2025-05-06 18:09:00 +01:00
frosch
8bbfbd0347 Codechange: Move spritelayout preprocessing to a separate class, which owns the heap allocations involved. 2025-05-06 18:30:42 +02:00
frosch
d9c43e7fda Codechange: Make TileLayoutSpriteGroup::ProcessRegisters return a DrawTileSpriteSpan on the stack, instead of a reference to a global. 2025-05-06 18:30:42 +02:00
frosch
51a7edd941 Codechange: Remove _input_events_this_tick. 2025-05-06 18:29:41 +02:00
frosch
42f9312f71 Codechange: Make station variable cache a member of StationScopeResolver. 2025-05-06 18:29:41 +02:00
frosch
b20b6da937 Codechange: The compiler ensures static variables are initialised only once, no need to track that manually. 2025-05-06 18:29:41 +02:00
frosch
75a775e59d Codechange: Make GetCurrentLocale return a std::string instead of a reference to a static buffer.
For win32 this is even a fix, because the static buffer was only updated once. Later calls discarded the determined locale.
2025-05-06 18:29:41 +02:00
frosch
0d5b3ebd7f Codechange: Declare all IntervalTimers const, which can be const. 2025-05-06 18:29:41 +02:00
frosch
61cec33be2 Codechange: Add 'const' to static variables, which are only initialised once. 2025-05-06 18:29:41 +02:00
frosch
1900125c98 Codechange: Use string_view for FileExists. 2025-05-06 18:29:41 +02:00
Peter Nelson
d571491405
Codechange: Replace std::bitset<CONTENT_TYPE_END> with ContentTypes. (#14223)
#14214 added `ContentTypes` as en `EnumBitSet`, but some std::bitset existed already; they are now `ContentTypes` too.
2025-05-06 17:20:01 +01:00
translators
eca826b0a4 Update: Translations from eints
korean: 7 changes by telk5093
hungarian: 3 changes by vargaviktor
latvian: 3 changes by lexuslatvia
polish: 6 changes by pAter-exe
2025-05-06 04:46:37 +00:00
frosch
13349254ea
Fix #14216, d030d17: RealSpriteGroups referencing CallbackResultSpriteGroups were always treated as callback-failure. (#14218) 2025-05-05 16:13:41 +02:00
Peter Nelson
e23de03a99 Codechange: Use FlatSet for sprite picker list. 2025-05-05 14:00:38 +01:00
Peter Nelson
b06273f716 Codechange: Use FlatSet when searching tiles around stations. 2025-05-05 14:00:38 +01:00
Peter Nelson
7679b0bc46 Codechange: Use FlatSet when filtering and drawing badge names. 2025-05-05 14:00:38 +01:00
Peter Nelson
5fd7344a6d Codechange: Use FlatSet when creating rivers. 2025-05-05 14:00:38 +01:00
Peter Nelson
7c834921b2 Codechange: Use FlatSet for per-industry type industry lists. 2025-05-05 14:00:38 +01:00
Peter Nelson
6070f8d4f3 Codechange: Add FlatSet implementation.
This is a flat set implemented using a sorted vector for storage.
2025-05-05 14:00:38 +01:00
Peter Nelson
2355d67e11
Codechange: Use EnumBitSet instead of Vector to record received content types. (#14214) 2025-05-05 08:55:34 +01:00
translators
a46b885640 Update: Translations from eints
english (au): 1 change by krysclarke
russian: 2 changes by Ln-Wolf
2025-05-05 04:47:18 +00:00
Peter Nelson
d7563096c6
Doc: Tweak documentation for consistency. (#14211)
* Remove/add line breaks so spacing is the same.
* Fix ToC links.
2025-05-04 20:16:29 +01:00
Peter Nelson
ac76212b80 Fix: Closing the Game Options window closes all textfile windows.
Record the parent window that opens a textfile window so only child windows are closed instead of all.
2025-05-04 19:36:46 +01:00
Peter Nelson
dabf2ede67 Change: Add methods to close child windows with a specific window number. 2025-05-04 19:36:46 +01:00
Rubidium
0724b3cda8 Codechange: replace SQChar with char 2025-05-04 16:59:06 +02:00
Rubidium
1f411f8a16 Codechange: use string_view for squirrel parameter checks 2025-05-04 16:59:06 +02:00
Rubidium
588b0de3de Codechange: hide SQString internals behind std::string_view/std::span 2025-05-04 16:59:06 +02:00
Rubidium
635ca3739f Codechange: use std::string_view in squirrel lexer 2025-05-04 16:59:06 +02:00
Rubidium
4255a94779 Codechange: use std::span over char* for writing the buffers 2025-05-04 15:32:52 +02:00
Rubidium
6817f52d9b Codechange: move definition of getcwd for Windows to where it is used 2025-05-04 15:32:52 +02:00
Rubidium
6189bbc45a Codechange: return std::string_view for convert_from_fs 2025-05-04 15:32:52 +02:00
Rubidium
6caa08098c Codechange: remove char* StringConsumer 2025-05-04 15:32:52 +02:00
Peter Nelson
3e608b5fe4
Fix: Zoom-scroll extra viewports only if the mouse cursor is over the viewport. (#14209) 2025-05-04 14:16:05 +01:00
Rubidium
afc1e76575 Codefix: StartNewThread uses char* after returning 2025-05-04 14:05:15 +02:00
Rubidium
8f74c08ea6 Codechange: put SQRegFunctions into initializer_list and use ranged for loops 2025-05-04 14:05:05 +02:00
Rubidium
f4fc8f6b38 Codechange: replace Error with simple throw 2025-05-04 14:05:05 +02:00
Rubidium
9d8a612bfb Codechange: remove unused function 2025-05-04 10:43:56 +02:00
Rubidium
5e3c7c4146 Codechange: char* -> char * 2025-05-04 10:43:56 +02:00
Rubidium
3f2b39e3f8 Codechange: replace char* where out-of-date 2025-05-04 10:43:56 +02:00
Rubidium
d697280493 Codechange: remove now obsolete char* tests
The function is std::string_view and there are std::string_view tests as well.
2025-05-04 10:43:56 +02:00
Rubidium
d01bebbd18 Codefix 26a4da9b01: MinGW compilation failure 2025-05-04 09:07:02 +02:00
translators
7d7a6bd32c Update: Translations from eints
norwegian (bokmal): 3 changes by eriksorngard
2025-05-04 04:46:05 +00:00
frosch
8571af9833 Codechange: Turn ZoomLevel into enum class. 2025-05-03 23:21:09 +02:00
frosch
c0d4ab69d0 Codechange: Add a container to index data by zoom level. 2025-05-03 23:21:09 +02:00
frosch
7055ea0aee Codechange: Define sequential operators for ZoomLevel. 2025-05-03 23:21:09 +02:00
frosch
bbfda39ac3 Codechange: Add ZoomLevels bit set. 2025-05-03 23:21:09 +02:00
frosch
48d09af039 Codechange: Simplify weird range check. 2025-05-03 23:21:09 +02:00
Rubidium
d464961c41 Codechange: use std::string_view for SQ stack and function info 2025-05-03 23:02:09 +02:00
Rubidium
0bc773215e Codechange: use std::optional<std::string_view> to make the intent of function clearer 2025-05-03 23:02:09 +02:00
Rubidium
ead3b96883 Codechange: use std::string_view to create SQString 2025-05-03 23:02:09 +02:00
Rubidium
fca99967a7 Codechange: make sq_scratchpad use std::span<char> 2025-05-03 23:02:09 +02:00
Rubidium
b4d9682f21 Codechange: use std::string_view for sq_throwerror 2025-05-03 23:02:09 +02:00
Rubidium
ec79ceb2be Codechange: use std::string_view for sq_pushstring 2025-05-03 23:02:09 +02:00
Rubidium
3020e615a9 Codechange: use std::string_view for squirrel compilation 2025-05-03 23:02:09 +02:00
Rubidium
26a4da9b01 Codechange: replace last strncmp uses 2025-05-03 21:51:01 +02:00
Peter Nelson
31754a0afd
Fix: Changing monospace font didn't refresh the monospace width cache. (#14185) 2025-05-03 18:34:45 +01:00
Peter Nelson
7596f98e2d
Codechange: Cache layouted text for the last used width. (#14177) 2025-05-03 18:33:47 +01:00
Peter Nelson
bd1a3fe0b7
Change: Remove the limit of 20 parameters to a Script Text string. (#14193) 2025-05-03 18:33:29 +01:00
frosch
518a34c286 Codechange: Use std::byte for generic buffers. 2025-05-03 18:43:20 +02:00
frosch
02082a0211 Codechange: Deduplicate array lookup. 2025-05-03 18:43:20 +02:00
frosch
bb767608de Codechange: Pass SpriteType as direct parameter to SpriteEncoder::Encoder. 2025-05-03 18:43:20 +02:00
frosch
c3aa3f140c
Codechange: Use more std::string_view. (#14197) 2025-05-03 18:40:37 +02:00
frosch
74a275f37b
Add: [NewGRF] Add purchase list Action3 CID for houses, industries, industry tiles, airports and airport tiles. (#14121) 2025-05-03 17:50:20 +02:00
frosch
9ac9798d7f
Codechange: Remove usages of stoi and stol. (#14196) 2025-05-03 17:46:30 +02:00
Rubidium
b6afd8d2b6 Codechange: remove some completely unused squirrel files 2025-05-03 17:14:10 +02:00
Rubidium
85f1110569 Codechange: rewrite ini file parsing with the StringConsumer 2025-05-03 17:13:33 +02:00
Rubidium
6a9f694158 Codechange: remove StrEmpty 2025-05-03 15:58:14 +02:00
Rubidium
d037dbb42a Codechange: use std::string_view for locales 2025-05-03 15:58:14 +02:00
Rubidium
96fd291693 Codechange: introduce GetEnv that returns optional based on std::getenv 2025-05-03 15:58:14 +02:00
Rubidium
04a6a55e94 Codechange: replace StripTrailingWhitespace with StrTrimView 2025-05-03 15:57:53 +02:00
Rubidium
1f39d469ff Codechange: pass the characters to trim to StrTrimView 2025-05-03 15:57:53 +02:00
Rubidium
e2db8277b8 Codefix: implement StrTrimInPlace without assigning a borrowed view of itself 2025-05-03 15:57:53 +02:00
Rubidium
4109b6848b Codechange: replace manual trim and std::from_chars with ParseInteger 2025-05-03 15:57:53 +02:00
Rubidium
414f6a3067 Codechange: add support for parsing octal numbers 2025-05-03 15:57:53 +02:00
Rubidium
c79abc6da6 Codechange: reduce dependence on C-style strings in OpenGL 2025-05-03 14:24:49 +02:00
Rubidium
278aee2c19 Codechange: use std::string_view for sq_getstring 2025-05-03 14:24:28 +02:00
translators
f4f05dea33 Update: Translations from eints
chinese (traditional): 1 change by KogentaSan
chinese (simplified): 1 change by WenSimEHRP
greek: 1 change by gh658804
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
dutch: 8 changes by Afoklala
portuguese: 3 changes by jcteotonio
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by pAter-exe
2025-05-03 04:45:31 +00:00
Peter Nelson
8b14faaa40
Codechange: Add version of DrawStringMultiLine that performs clipping test. (#14189)
Normally DrawStringMultiLine does not perform any clipping, as the return value may be needed if it the text is not drawn.

In some specific cases the height is already known, so it is possible to test for clipping, which can cut down on layouting time for text which won't be visible.
2025-05-02 22:59:55 +01:00
Iris-Persephone
2f020abe74
Add: "Many random towns" button in scenario editor now prompts for the number of towns, with defaults based on new game settings (#14158) 2025-05-02 22:54:21 +01:00
Peter Nelson
3eba97f67c
Codechange: Scrollbar Count no longer needs to be clamped to uint16_t. (#14184) 2025-05-02 22:21:05 +01:00
Peter Nelson
f7db4938ce
Fix #14098: Use 64-bit type for MIDI realtime information. (#14144) 2025-05-02 22:20:44 +01:00
Rubidium
c420ba349d Codechange: use std::string_view over char* 2025-05-02 23:12:43 +02:00
Rubidium
f2a32c6d13 Codechange: use std::byte instead of char for calculating arbitrary byte offsets 2025-05-02 23:12:43 +02:00
Peter Nelson
932dca927b
Fix: Crash/Undefined behaviour in station view window. (#14183)
No column limit was applied when drawing waiting cargo, which could cause out-of-bounds array access.
2025-05-02 08:02:35 +01:00
translators
e0a9c7d818 Update: Translations from eints
english (au): 2 changes by krysclarke
chinese (traditional): 3 changes by KogentaSan
chinese (simplified): 6 changes by WenSimEHRP
greek: 2 changes by gh658804
russian: 2 changes by Ln-Wolf
finnish: 3 changes by hpiirai
portuguese (brazilian): 2 changes by pasantoro
polish: 2 changes by pAter-exe
2025-05-02 04:45:34 +00:00
Peter Nelson
ae9646eb0a
Change: Use same padding as NewGRF parameters for AI/GS parameters lists. (#14118) 2025-05-01 22:36:53 +01:00
Rubidium
5ca686261e Codechange: use std::string_view for the string setting defaults 2025-05-01 23:24:43 +02:00
Rubidium
5c7b04a0c2 Codechange: use std::string_view for 'x-of-many' settings 2025-05-01 23:24:43 +02:00
Rubidium
7805c1c189 Codechange: use std::string_view for ini_key 2025-05-01 23:24:43 +02:00
Peter Nelson
d958d50985
Fix: Small order list arrow was wrong direction for RTL text. (#14174)
Add sprite for small left arrow and use for small order list when using an RTL language.
2025-05-01 22:08:24 +01:00
Loïc Guilloux
41b113840a
Fix: [Script] Access to enum/consts defined outside of main.nut (#14176) 2025-05-01 18:16:32 +02:00
Loïc Guilloux
1f212e6f2a
Fix: Handle \t when loading GS strings from savegame (#14180) 2025-05-01 16:48:02 +02:00
Loïc Guilloux
6f4994329c
Fix bf8a241f: Handle \t in trailing whitespaces (#14178) 2025-05-01 12:32:00 +02:00
translators
a30f251d05 Update: Translations from eints
hungarian: 99 changes by meskobalazs
russian: 8 changes by Ln-Wolf
finnish: 24 changes by hpiirai
latvian: 70 changes by lexuslatvia
2025-05-01 04:47:22 +00:00
Rubidium
fbe80f31fe Codechange: replace char* in GetOptData with std::string_view 2025-04-30 23:49:06 +02:00
Rubidium
c1a287ad17 Codechange: make some saveload functions work natively with std::string_view 2025-04-30 23:49:06 +02:00
Rubidium
855377191e Codechange: replace some more char*s with std::string_view 2025-04-30 23:49:06 +02:00
frosch
a80c11a6e8
Fix 66733e2a: Textbuf was broken, and did not insert any input. (#14173) 2025-04-30 19:31:52 +00:00
Peter Nelson
7dd3bed10f
Fix #14170, 7fd0e6c27d: Missing spaces for timetabled order strings. (#14172) 2025-04-30 19:54:54 +01:00
frosch
316279f4b4 Codechange: Use more std::string_view. 2025-04-30 19:33:56 +02:00
frosch
9cf36dac39 Codechange: Use data() instead of c_str(), if no NUL termination is needed. 2025-04-30 19:33:56 +02:00
frosch
9e90d4ed79 Codefix: Do not assign nullptr to std::string_view. 2025-04-30 19:33:56 +02:00
frosch
36ce1f890a Codechange: Remove c_str, if std::string_view is already accepted. 2025-04-30 19:33:56 +02:00
frosch
b564fbb5e6 Codechange: Use StringConsumer to parse hotkeys. 2025-04-30 19:33:56 +02:00
frosch
66733e2a50 Codechange: Use std::string_view in IME input handling. 2025-04-30 19:33:56 +02:00
frosch
6db13df3b5 Add: [BaseSet] Allow basesets to set minor and patch versions in obg/obs/obm files. 2025-04-30 15:23:27 +02:00
frosch
d30fee4a99 Codechange: Improve debug/error messages when reading baseset metadata. 2025-04-30 15:23:27 +02:00
Rubidium
708e6a512d Codechange: replace char* with C++ style strings 2025-04-30 12:05:04 +02:00
Peter Nelson
356b0159c7
Fix 261e09a549: Compilation failure with Fluidsynth enabled. (#14167) 2025-04-30 07:27:57 +01:00
translators
7bec2029fa Update: Translations from eints
english (au): 4 changes by krysclarke
norwegian (bokmal): 5 changes by eriksorngard
chinese (traditional): 4 changes by KogentaSan
greek: 8 changes by gh658804
russian: 4 changes by Ln-Wolf
finnish: 4 changes by hpiirai
portuguese: 4 changes by jcteotonio
portuguese (brazilian): 4 changes by pasantoro
polish: 4 changes by pAter-exe
2025-04-30 04:46:51 +00:00
Peter Nelson
0abebfce1c
Codechange: Use result of .find() instead of looking up multiple times. (#14154) 2025-04-29 23:52:46 +01:00
Peter Nelson
aa9e8b422c
Fix #14166, dfd9fbf873: Loan was no longer invalidated when refreshing finance window. (#14168)
In most cases the company loan does not change, but it should be updated in case it does.
2025-04-29 23:52:11 +01:00
Rubidium
f4ad614285 Codechange: use std::string_view for FS2OTTD and OTTD2FS 2025-04-29 22:33:32 +02:00
Rubidium
ef71ce0a9d Codechange: return std::string_view for Textbuf::GetText() 2025-04-29 22:15:49 +02:00
Rubidium
261e09a549 Codechange: remove char* from base driver code 2025-04-29 21:09:18 +02:00
frosch
d030d17bd6 Codechange: Do not use a mutable global to return calculated VarAction2 results. 2025-04-29 20:35:46 +02:00
frosch
e90b68d504 Codechange: Pass SpriteGroup as reference to ResolveReal. 2025-04-29 20:35:46 +02:00
frosch
7c946d97da Codefix: Build with OPTION_DEDICATED=OFF and CMAKE_DISABLE_PRECOMPILE_HEADERS=ON. 2025-04-29 20:26:23 +02:00
frosch
afe3dfb3a4 Codechange: Use format instead of to_string. 2025-04-29 20:26:23 +02:00
frosch
fda93b6f35 Codechange: Add format_append as short-hand to format_to + back_inserter. 2025-04-29 20:26:23 +02:00
frosch
98481ecc01 Codechange: Replace strtol, strtoll, stroul and strtoull with ParseInteger. 2025-04-29 20:14:56 +02:00
frosch
cdafc50c94 Codechange: Replace atoi and atoll with ParseInteger. 2025-04-29 20:14:56 +02:00
frosch
3973199879 Change: ParseInteger now checks for trailing junk chars. 2025-04-29 20:14:56 +02:00
frosch
79b2202f2e Codechange: Use StringConsumer for parsing more strings. 2025-04-29 20:14:56 +02:00
frosch
e7d758c82a Codechange: Replace sscanf with StringConsumer. 2025-04-29 20:14:56 +02:00
frosch
8027e31f47 Codechange: Remove virtual functions SpriteGroup::GetResult and GetNumResults. They are only implemented in and called via ResultSpriteGroup. 2025-04-29 10:35:10 +02:00
frosch
010b944173 Codechange: Move SpriteGroup cast from callers into Resolve. 2025-04-29 10:35:10 +02:00
Rubidium
af25eecc15 Codechange: use const for std::string_view where appropriate 2025-04-29 10:15:18 +02:00
Rubidium
78250c3bba Codechange: remove const char* overloads when there are std::string_view and std::string& overloads 2025-04-29 10:14:53 +02:00
Peter Nelson
a5578166bb Codechange: Pass Script Info by reference. 2025-04-28 23:08:20 +01:00
Peter Nelson
341cdbc16b Codechange: Pass Script engine by reference. 2025-04-28 23:08:20 +01:00
Peter Nelson
72ca962b84 Codechange: Pass ScriptInstance by reference. 2025-04-28 23:08:20 +01:00
Peter Nelson
13fcc0900e
Change: Use enum/bitset to track which script configuration items are defined. (#14150)
Removes magic numbers, and simplifies compatibility. It is no longer necessary to provide values which won't be used.
2025-04-28 23:07:57 +01:00
Rubidium
b20b56d5fc Codechange: store revision information in C++ style strings 2025-04-28 23:48:32 +02:00
Rubidium
8b1c1cc33d Codechange: provide 'sv' (string_view) literals globally 2025-04-28 23:39:33 +02:00
Rubidium
be53bd320d Codechange: replace char* from settingsgen 2025-04-28 23:27:46 +02:00
frosch
47b5ca6115 Fix: [NewGRF] Computed VarAction2 callback results were not always properly masked to 15 bit results. 2025-04-28 23:25:31 +02:00
frosch
d90f6f01cc Codechange: CALLBACK_FAILED is an internal constant, do not use it as numeric value in VA2 computations. 2025-04-28 23:25:31 +02:00
frosch
30b1eb6e5f
Fix: [NewGRF] The result of Action123 evaluation affected rerandomisation in a weird corner case. (#14139)
Rerandomisation does not care about the Resolve result.
But we skipped it, in case of 'invalid SpriteGroup reference'.
2025-04-28 23:24:42 +02:00
frosch
b281c5616e Change: [NewGRF] If Action123 does not resolve in a valid SpriteSet, prefer drawing the default sprite instead of an invalid sprite. 2025-04-28 22:20:54 +02:00
frosch
7b08170ac8 Codechange: Replace a magic value with a maybe less magical constant. 2025-04-28 22:20:54 +02:00
Rubidium
360670626b Codechange: replace char* with std::string_view 2025-04-28 21:31:12 +02:00
Rubidium
9107c3f6c6 Codechange: add std::string_view variant of FileHandle::Open 2025-04-28 21:31:12 +02:00
Peter Nelson
2c4897c2cd
Codechange: Use EnumBitSet for HouseZones. (#14137) 2025-04-28 20:27:43 +01:00
frosch
f5a9eae8b1 Fix: [NewGRF] AI station construction callback did not work for stations with ID >= 0x100. 2025-04-28 20:50:13 +02:00
frosch
e2084bbdcd Codechange: Replace out parameters with result tuples. 2025-04-28 20:50:13 +02:00
frosch
0c6426cb2d Fix: Out-of-bounds read, if NewGRF stations provided no spritesets. 2025-04-28 20:49:20 +02:00
frosch
0f1ef96ca1 Codechange: Road stops do not use RealSpriteGroup, ResolveReal is never called. 2025-04-28 20:49:20 +02:00
Rubidium
9116f96e2e Codechange: replace char * with std::string_view 2025-04-28 17:53:18 +02:00
Rubidium
c6ea0ce961 Codechange: use std::span for transferring data in network code 2025-04-28 17:53:18 +02:00
frosch
b7e7f08f78 Codechange: Simplify usage of GRFFileProps by adding some common helper methods. 2025-04-28 13:44:46 +02:00
frosch
46494c6d44 Codechange: Rename GRFFileProps to SubstituteGRFFileProps. 2025-04-28 13:44:46 +02:00
Richard Wheeler
298e02d593
Fix: List Ctrl+Click behaviour for vehicle details tooltip (#14127)
Also change mention of "road vehicle" to "vehicle", in line with vehicle order, refit, reverse, etc. tooltips. Fixes #14128
2025-04-28 07:00:18 +01:00
translators
68ba2735ea Update: Translations from eints
swedish: 109 changes by Brickblock1
spanish (mexican): 1 change by absay
english (us): 1 change by 2TallTyler
2025-04-28 04:46:30 +00:00
Rubidium
794ba1f5da Fix 29ceaf0a8: checking std::optional against nullptr caused crash 2025-04-27 21:10:12 +02:00
Rubidium
49ef3eee13 Codechange: replace char* with std::string_view 2025-04-27 20:08:02 +02:00
frosch
e1859df1c0 Codechange: Use enums as keys for the spritegroups in FixedGRFFileProps. 2025-04-27 19:50:51 +02:00
frosch
05504ec463 Codechange: Use SingleGRFFileProps, if the feature has no spritegroup keys. 2025-04-27 19:50:51 +02:00
frosch
41a20e512d Codechange: Use proper enum type to index sprite groups in VariableGRFFileProps. 2025-04-27 19:50:51 +02:00
frosch
893aa0fb91 Codechange: Add an explicit enum member for the default spritegroup of badges. 2025-04-27 19:50:51 +02:00
Rubidium
29ceaf0a84 Codechange: use std::string_view over const char * 2025-04-27 18:04:04 +02:00
Rubidium
c7056866a3 Codechange: remove manual param count; in all cases strlen(params) == nparams 2025-04-27 17:57:53 +02:00
Rubidium
781187b8a6 Codechange: replace C-style strings with std::string_view related to strings functions 2025-04-27 17:57:42 +02:00
Rubidium
4e3e3d5be6 Codechange: introduce transparent hash lookup for strings 2025-04-27 17:57:42 +02:00
Peter Nelson
7bbf380931
Fix #14125, 828e808444: NewGRF sounds were not loaded. (#14130)
NewGRF Action 11 should be handled in both INIT and ACTIVATION stages for sounds to be loaded.

Additionally the Action 0 feature test failed due to offsets involved.
2025-04-27 15:20:38 +00:00
Rubidium
b9667ec3d1 Codechange: use std::string_view for scripts 2025-04-27 17:00:25 +02:00
translators
864fe29028 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (traditional): 1 change by KogentaSan
galician: 66 changes by pvillaverde
chinese (simplified): 1 change by WenSimEHRP
korean: 72 changes by telk5093
greek: 1 change by gh658804
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
portuguese: 1 change by jcteotonio
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by pAter-exe
2025-04-27 04:44:13 +00:00
Peter Nelson
5a7893b730
Fix #14104, 67a0fcc: Don't base timetable timing decisions on client settings. (#14105)
Client settings different between clients so the resultant timings may be different.

Partially reverts 67a0fcc.
2025-04-26 22:39:01 +01:00
Peter Nelson
b87ce9c845
Change: Draw info headers as shade of window colour instead of pixel colour. (#14123)
Use the normal or lightest colour gradient to pick a suitable colour, instead of an arbitrary pixel colour.

(Except for the NewGRF window's info panel, this happens to be the same colour.)
2025-04-26 22:38:24 +01:00
frosch
55fad9c78a
Add: Limit height of settings description, and add scrollbar. (#14102) 2025-04-26 22:34:18 +02:00
frosch
d85f6dccc5
Fix 5575379: Crash with default airports. (#14120) 2025-04-26 22:29:01 +02:00
frosch
f62f728187
Codechange: Move usage of ResolverObjects to newgrf_xxx.cpp (#14116) 2025-04-26 20:53:50 +02:00
frosch
be39a05327 Fix: Road vehicle blocking and train collissions used slightly inconsistent distance thresholds. 2025-04-26 19:32:59 +02:00
frosch
3a70d1e2f7 Codechange: Pass the max-distance as parameter to VehiclesNearTileXY. 2025-04-26 19:32:59 +02:00
frosch
2df1233f1f Codechange: Clamp the search area to valid values for the hash bucket selection.
The bucket selection uses a truncating division instead of a flooring division, so it does not work for negative positions.
Anyhow, there are no negative tile coordinates, so just clamp the search area.
2025-04-26 19:32:59 +02:00
frosch
0f76ba122c Codefix: VehiclesNearTileXY yielded all vehicles with matching hashes, even if they are far away. 2025-04-26 19:32:59 +02:00
frosch
c14e4a6db1 Codefix: Rect::Contains did not consider the bottom/right edges as inside. 2025-04-26 19:32:59 +02:00
Rubidium
3235ec4cf8 Codefix: checking unsigned int >= 0 is pointless, check before subtraction 2025-04-26 18:31:36 +02:00
frosch
ce2155ab27 Codechange: Remove unused FindVehicleOnPosXY/HasVehicleOnPosXY. 2025-04-26 16:54:56 +02:00
frosch
98ac75e74f Codechange: Replace FindVehicleOnPosXY/HasVehicleOnPosXY with VehiclesNearTileXY/HasVehicleNearTileXY. 2025-04-26 16:54:56 +02:00
frosch
9f1c04c0e1 Codechange: Add VehiclesNearTileXY and HasVehicleNearTileXY to iterate over/check for ground vehicles near a tile coordinate. 2025-04-26 16:54:56 +02:00
frosch
ac3ed9f3ad Codechange: Deduplicate and simplify tile hash arithmetic. 2025-04-26 16:54:56 +02:00
Rubidium
b4d4d730a5 Codechange: use std::string_view for town name generation 2025-04-26 16:30:30 +02:00
Rubidium
30f381acee Codechange: use std::string_view for NetworkAddress 2025-04-26 16:30:16 +02:00
Rubidium
e1db09a41f Codechange: use std::string_view for NewsTypeData 2025-04-26 16:30:16 +02:00
Rubidium
42f0aa24f6 Codechange: use std::string_view for connection/URI strings 2025-04-26 16:30:16 +02:00
Rubidium
a5812a45f8 Codechange: use std::string view for URI and std::move for data 2025-04-26 16:30:16 +02:00
Rubidium
d1a7d30572 Codechange: use std::string_view for some settings functions 2025-04-26 16:30:16 +02:00
Rubidium
4476ce804d Codechange: use std::string_view for GetNextParameterString 2025-04-26 16:30:16 +02:00
frosch
398524e49a
Add: [NewGRF] Provide random bits in var10 of house callback 1C 'construction stage changed'. (#14095) 2025-04-26 15:58:44 +02:00
frosch
55753795bf
Fix: [NewGRF] Cargo-types for airport-tile animation-triggers were not properly translated. (#14092) 2025-04-26 15:58:30 +02:00
frosch
1ea1dbd19e
Add: [NewGRF] Station/roadstop animation-triggers 'tile loop' (bit 7) and 'path reservation' (bit 8). (#14080) 2025-04-26 14:44:55 +02:00
frosch
d3ae6bc9a8
Fix: [NewGRF] For animation-triggers which do not supply a cargo-type in var18, the var18 bits should remain empty. (#14091) 2025-04-26 14:44:07 +02:00
frosch
0d9074769d
Change: [NewGRF] Animation-trigger 'construction stage changed' of houses and industries now also triggers at construction start. (#14089) 2025-04-26 14:42:49 +02:00
Rubidium
365eed533d Codechange: use std::string_view for console commands 2025-04-26 14:15:10 +02:00
Rubidium
f04cf54939 Codechange: make IConsoleCmdExec use C++ strings internally 2025-04-26 14:15:10 +02:00
Loïc Guilloux
28d0e6dfc0
Change: [Script] Reject scripts using negative version (#14096) 2025-04-26 14:02:36 +02:00
Peter Nelson
4a5db57f7b
Fix #14107: Mark the company value in the company view window dirty when it changes. (#14112) 2025-04-26 11:56:11 +00:00
Peter Nelson
dfd9fbf873
Codechange: Defer refreshing company finance windows. (#14111)
During each game tick every cargo payment will issue an Invalidate of the status bar and company finance window. While this doesn't paint the window yet, it does need to search for open windows, and then mark a area of dirty blocks, which is done for every Invalidate.

Instead, set a bit in a CompanyMask, and test these bits once after the game tick is complete.

This reduces the amount of dirtying, and allows more specific widgets to be dirtied instead of the whole window.
2025-04-26 10:50:51 +00:00
Peter Nelson
a1f086e60c
Fix #14107: Invalidate all shared vehicle windows when changing group. (#14110)
Previously only windows of the first vehicle were invalidated.
2025-04-26 10:49:41 +00:00
translators
bb1d561369 Update: Translations from eints
chinese (traditional): 9 changes by KogentaSan
english (us): 66 changes by 2TallTyler
greek: 65 changes by gh658804
russian: 77 changes by Ln-Wolf
dutch: 66 changes by Afoklala
portuguese: 65 changes by jcteotonio
polish: 68 changes by pAter-exe
2025-04-26 04:44:12 +00:00
Rubidium
08ce16018b Codechange: make start-ai console command parsing work with std::string_view 2025-04-25 19:04:22 +02:00
Rubidium
ccbf7f4a46 Codechange: validate the given seed 2025-04-25 19:04:22 +02:00
Rubidium
86039a5b69 Codechange: make SetDebugString use C++-style strings and function types 2025-04-25 19:04:22 +02:00
Rubidium
498a0f1c1b Codechange: use C++ strings over C-strings 2025-04-25 19:04:22 +02:00
frosch
4a09860c53
Fix: Focus settings filter box (only) when the tab becomes active. (#14100) 2025-04-25 12:04:26 +02:00
frosch
f554d799d7
Change: [NewGRF] Provide shared random bits in multi-tile animation-triggers of airport tiles and objects, just like for other features. (#14090) 2025-04-25 10:01:01 +02:00
Peter Nelson
8b927220c7
Change: Move Game Options toggles to before label, add Off/On text. (#14097) 2025-04-25 07:49:33 +01:00
translators
e61762a805 Update: Translations from eints
english (au): 65 changes by krysclarke
norwegian (bokmal): 67 changes by eriksorngard
chinese (traditional): 67 changes by KogentaSan
spanish (mexican): 66 changes by absay
chinese (simplified): 91 changes by WenSimEHRP
finnish: 65 changes by hpiirai
french: 61 changes by ottdfevr
portuguese (brazilian): 65 changes by pasantoro
2025-04-25 04:46:37 +00:00
Peter Nelson
87b5b0ffa3
Fix 2b80812922: Map size column in server list may be too wide. (#14094)
Incorrect change from SetDParamMaxValue to GetParamMaxValue.
2025-04-24 21:05:31 +01:00
Rubidium
2087bca87d Codechange: replace atoi with ParseInteger in console commands 2025-04-24 18:10:01 +02:00
Rubidium
ddc0d6ead3 Codechange: use string comparision for ConExec's second parameter 2025-04-24 18:10:01 +02:00
Richard Wheeler
a01d47b333
Doc: Correct baseset obg file MD5 and url documentation (#14086) 2025-04-24 12:24:32 +01:00
frosch
880a947eb3 Fix: [NewGRF] Randomisation-trigger 'path reservation' did not work for waypoints. 2025-04-24 09:19:43 +02:00
frosch
bc0eaf9ac4 Codechange: Allow passing waypoints to Trigger(Station|RoadStop)Randomisation. 2025-04-24 09:19:43 +02:00
Peter Nelson
c0cd7cafe4
Change: Remove minimum width from advanced settings panel of Game Options window. (#14088)
Previous minimum width of 400 was fairly arbitrary and isn't necessary when
the minimum size is suitably constrained by other widgets in the window.

This allows the window to be narrower for CJK languages.
2025-04-23 23:39:35 +00:00
Peter Nelson
7846f0f4ee
Fix a4dc7249ee: Changing language or interface scale could hang. (#14087)
A bit of hysteresis caused by OnResize calling ReInit calling OnResize calling ReInit calling OnResize calling ReInit ...
2025-04-24 00:29:54 +01:00
Peter Nelson
78d3eaf3e2 Change: Slider widget can now be colourful. 2025-04-23 19:07:52 +01:00
Peter Nelson
20738865f0 Change: Use standard mauve/yellow scheme for game options window.
This is the colour scheme used by AI/GS settings, NewGRF settings and (previously) advanced settings.
2025-04-23 19:07:52 +01:00
Peter Nelson
17e7dafa2a Change: Add alternate_colour widget data for boolean button.
Allows boolean button to have different background and button colours.
2025-04-23 19:07:52 +01:00
Peter Nelson
7953a97cbb Change: Adjust section names in Graphics options tab.
"Interface size" and "Graphics" section names do not make much sense any more.
2025-04-23 19:07:52 +01:00
Peter Nelson
77da79a052 Codechange: Remove unnecessary SetMinimalSize from Game Options window. 2025-04-23 19:07:52 +01:00
Peter Nelson
a4dc7249ee Change: Merge Game Options and Game Settings together.
Game Settings is now an additional 'Advanced' tab in the Game Options window.
2025-04-23 19:07:52 +01:00
frosch
6f056283f2
Fix: [NewGRF] For roadstop multi-tile-animation-triggers, the upper 16 bits were not the same for all tiles. (#14084) 2025-04-23 19:26:09 +02:00
Loïc Guilloux
f8bdc1e612
Fix f5ffd47: Don't skip separator while reading a record (#14083) 2025-04-23 17:30:51 +02:00
Peter Nelson
6d5aee0545
Codechange: Restructure RoadStop Entries to reduce pointers. (#14069)
A RoadStop must own both west and east `Entry`s, but they are allocated separately.

Combine this allocation into one instead.
2025-04-23 08:29:34 +01:00
Peter Nelson
41ed5f9822
Fix c7d6934816: Town view caption lost "(City)" flag. (#14082) 2025-04-23 08:14:08 +01:00
translators
d9dc6cb5e4 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (traditional): 7 changes by KogentaSan
chinese (simplified): 201 changes by WenSimEHRP
greek: 1 change by gh658804
hungarian: 9 changes by meskobalazs
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
latvian: 1 change by lexuslatvia
portuguese: 1 change by azulcosta
portuguese (brazilian): 1 change by pasantoro
polish: 1 change by pAter-exe
2025-04-23 04:46:38 +00:00
Peter Nelson
d028c7f9e2
Codefix: Incorrect type for OnDropdownSelect widget parameter. (#14074) 2025-04-22 22:44:25 +01:00
Rubidium
4149384ebc Codechange: simplify and move GetArgumentInteger 2025-04-22 23:16:15 +02:00
frosch
2bee313642 Codechange: Replace FindVehicleOnPos with 'for' loop. 2025-04-22 22:12:59 +02:00
frosch
06c399b79e Codechange: Replace HasVehicleOnPos and callbacks with HasVehicleOnTile and lambda-predicates. 2025-04-22 22:12:59 +02:00
frosch
dacd77b2bd Codechange: Use FindVehicleOnPos instead of HasVehicleOnPos, if there is no stop condition. 2025-04-22 22:12:59 +02:00
frosch
fca3103d8c Codechange: Add iterator for vehicles on a tile. 2025-04-22 22:12:59 +02:00
Rubidium
917ef03e97 Codechange: use std::string_view in IConsole settings API 2025-04-22 19:52:37 +02:00
Rubidium
b279bc37e7 Codechange: use std::string_view to set string settings 2025-04-22 19:52:37 +02:00
Rubidium
fdb8defa64 Codechange: use std::string_view to parse setting values 2025-04-22 19:52:37 +02:00
Peter Nelson
12118b201c
Change: Enhance visibility of disabled bool button. (#14071)
Apply masked fill to background as well.
2025-04-22 17:37:30 +01:00
translators
415ac07a08 Update: Translations from eints
chinese (simplified): 32 changes by WenSimEHRP
hungarian: 38 changes by meskobalazs
2025-04-22 04:46:01 +00:00
Peter Nelson
3aa82d5e63
Codechange: Use EnumBitSet for RoadStopStatusFlags. (#14068) 2025-04-21 20:16:23 +01:00
Peter Nelson
81edd1123a
Change: Use scaled instead of fixed dimensions for framerate graphs. (#14039) 2025-04-21 20:15:57 +01:00
frosch
d7ddea4032
Codechange: Turn AnimationTrigger enums into enum classes. (#14067) 2025-04-21 20:53:31 +02:00
frosch
61a0a520f6
Codechange: Unify random trigger enums and turn them into enum classes. (#14066) 2025-04-21 20:03:34 +02:00
frosch
f399b8eb29 Codechange: Unify naming of NewGRF animation callbacks. 2025-04-21 19:06:13 +02:00
frosch
264abfafe6 Codechange: Rename storage of random triggers to include the term 'random'. 2025-04-21 19:06:13 +02:00
frosch
39220a5feb Codechange: Unify naming of NewGRF random trigger functions. 2025-04-21 19:06:13 +02:00
frosch
368d131fb7 Codechange: Use 'construction stage' consistently, instead of 'construction state'. 2025-04-21 19:06:13 +02:00
frosch
98445088b1
Codechange: Move VehicleEnteredDepotThisTick call to a more suitable position. (#14065) 2025-04-21 17:52:03 +02:00
Peter Nelson
7d03cee512
Change: Include dragged train in depot tile length display. (#14060)
In the depot, when dragging a train over another train, the tile length displayed now includes the length of the dragged train.

As the parts are not moved yet, length changes due to callbacks are not taken into account.
2025-04-21 16:37:10 +01:00
frosch
2a62eea005
Codefix: Comment style. (#14064) 2025-04-21 17:25:09 +02:00
Peter Nelson
5b2754fdee Change: Use standard boolean toggle buttons for game options toggles. 2025-04-21 16:23:11 +01:00
Peter Nelson
d89753b88d Codechange: Add dedicated widget for boolean toggle buttons. 2025-04-21 16:23:11 +01:00
Peter Nelson
e3d2d68bd4 Change: Draw boolean toggle as a slider widget.
This improves usability as the slider position indicates the state instead of a red/green colour change.
2025-04-21 16:23:11 +01:00
Rubidium
e3858e81dc Codechange: use std::string_view over const std::string& for finding files 2025-04-21 17:20:00 +02:00
frosch
354ad43edb
Codechange: Remove unnecessary string constructions. (#14063) 2025-04-21 16:46:31 +02:00
Peter Nelson
e1fdc10227
Fix e114ed357d: Incorrect test of object flags allowed HQ to be removed. (#14062) 2025-04-21 15:45:29 +01:00
Loïc Guilloux
305c892b3a
Change: "setting" console command now shows default value (#14061) 2025-04-21 16:00:37 +02:00
Peter Nelson
788845f731
Change: Allow Double-Ctrl+Click on default size box to clear saved size. (#14055) 2025-04-21 14:16:29 +01:00
Peter Nelson
0cf7048a67
Change: Don't select content when toggling its download status. (#14059)
This improves usability when toggling content sorted by status, as the list position no longer jumps to the now (de)selected item, making it easier to (de)select multiple items.
2025-04-21 13:20:52 +01:00
Peter Nelson
9ff2b4991f
Change: Add scrollbar to infrastructure window. (#14056)
Company infrastructure window will no longer overflow the screen when lots of rail and road types are present.

To further declutter the list, we now only show a value when the count for that item is non-zero.
2025-04-21 08:46:09 +01:00
translators
5502618ac3 Update: Translations from eints
romanian: 1 change by ALEX11BR
2025-04-21 04:45:21 +00:00
Peter Nelson
e9a92b8795
Fix: Odd drawing and crash if scrollbar is not tall enough. (#14052)
Under certain conditions the scrollbar "tab" could be too large for the scrollbar, and cause issues.

Caused by an off-by-one in height calculation.
2025-04-20 23:23:52 +01:00
frosch
0efbb3a7a7
Doc: PR template referenced non-existing label. (#14050) 2025-04-20 23:02:33 +02:00
frosch
689f55a0ea
Fix #14044: Negative string parameters from GS were rendered as zero. (#14049)
String parameters are always stored as uint64_t. Negative values are sign-extended to int64_t and then casted to uint64_t.
The same applies to encoded strings. But ScriptText encoded them as int64_t.

Co-authored-by: rubidium42 <rubidium42@users.noreply.github.com>
2025-04-20 23:01:49 +02:00
Rubidium
4e14f0ac3f Codechange: pass network tokens as std::string_view or with move semantics where appropriate 2025-04-20 22:43:24 +02:00
Rubidium
c13956a58a Codechange: use std::string_view for connection strings 2025-04-20 22:43:24 +02:00
Rubidium
31433882a4 Codechange: use std::string_view for passing NetworkError strings 2025-04-20 22:43:24 +02:00
frosch
8aa2f6b8a6
Codefix: StringConsumer integer parsing failed for the most negative value, which has no positive equivalent. (#14048) 2025-04-20 22:20:53 +02:00
Peter Nelson
fc45bb5a2b
Codechange: Replace bitstuffed VehicleEnterTileStatus. (#14027)
VehicleEnterTileStatus was an bitset-style enum, but bitstuffed with a StationID. However the StationID part was only used by trains, and only in two locations.

Instead, return just the enum bitset. The two places which require the StationID just call GetStationIndex() directly.
2025-04-20 21:10:02 +01:00
frosch
cb113cfed0 Codefix: Add missing header includes. 2025-04-20 22:06:18 +02:00
frosch
461b73e21b Codefix: stdafx.h and safeguards.h should be the first and last include in every source file, and not appear in any header file. 2025-04-20 22:06:18 +02:00
frosch
54de376c55 Codechange: Make the squirrel-exporter skip ctor lists. 2025-04-20 21:07:12 +02:00
frosch
6256b55671 Codechange: Make the squirrel-exporter skip function bodies. 2025-04-20 21:07:12 +02:00
Rubidium
26de3404a4 Codechange: use std::string_view for sending chat messages 2025-04-20 13:31:41 +02:00
Rubidium
bb259b8e77 Codechange: use std::string_view for sending a remote console command (result) 2025-04-20 13:31:41 +02:00
Rubidium
d99edf2bbc Codechange: use std::string_view for kicking/banning 2025-04-20 13:31:41 +02:00
Rubidium
a0246bc8a7 Codechange: use std::string_view over std::string for NetworkTextMessage 2025-04-20 13:31:41 +02:00
Rubidium
a0e4dab771 Codechange: use std::string_view for NetworkAddress::IsInNetmask of std::string 2025-04-20 13:31:41 +02:00
frosch
ff2da0fc73 Codechange: Remove CircularTileSearch. 2025-04-20 12:50:45 +02:00
frosch
b956af631e Codechange: Replace CircularTileSearch with SpiralTileSequence. 2025-04-20 12:50:45 +02:00
frosch
0dada5a750 Codechange: Add SpiralTileSequence to iterate over a tile area the same ways as CircularTileSearch. 2025-04-20 12:50:45 +02:00
frosch
b9bd7b2cfe Codechange: Confusion of 'radius' and 'diameter' in variable names and comments. 2025-04-20 12:50:45 +02:00
Peter Nelson
e43e4327a7
Fix: Incorrect string display for autoreplace wagon removal status. (#14038) 2025-04-20 10:44:37 +01:00
translators
ee81313254 Update: Translations from eints
welsh: 1 change by Ansbaradigeidfran
vietnamese: 2 changes by KhoiCanDev
2025-04-20 04:43:37 +00:00
Peter Nelson
2b92d76e9d
Fix e49150f9ca: House picker crashes if selection is not available. (#14030)
This occurs because the extra invalidation in OnInit() also happens on construction, and too early.

Solution is to validate all instead of just position when invalidating in OnInit().
2025-04-19 15:04:18 +01:00
translators
d248f45d67 Update: Translations from eints
vietnamese: 7 changes by KhoiCanDev
2025-04-19 04:44:03 +00:00
frosch
43ea6c9b88 Codechange: Turn AyStar into an actual class with virtual methods instead of function pointers. 2025-04-19 00:24:15 +02:00
frosch
97ead8e241 Codechange: Remove unused options from AyStar. 2025-04-19 00:24:15 +02:00
frosch
53899c3c21 Codechange: Replace vehicle viewport hash macros with functions. 2025-04-18 23:41:37 +02:00
frosch
cde350dc01 Codechange: Replace macros GENERAL_SPRITE_COLOUR and COMPANY_SPRITE_COLOUR with functions GetColourPalette and GetCompanyPalette. 2025-04-18 23:41:37 +02:00
frosch
c2c5dae760 Codechange: Turn GREY_SCALE macro into constexpr function. 2025-04-18 23:41:37 +02:00
frosch
8f335a84cf Codechange: Turn GetCustom(Vehicle|Rotor)(Sprite|Icon) macros into functions. 2025-04-18 23:41:37 +02:00
frosch
8f8e997575 Codechange: Replace local macro with lambda. 2025-04-18 23:41:37 +02:00
frosch
68016031cf Codechange: Turn macros GetCompanyHQSize and IncreaseCompanyHQSize into functions. 2025-04-18 23:41:37 +02:00
frosch
0eb6964311 Codechange: Change ScreenshotCallback into a std::function, so there is no need for void* user data. 2025-04-18 22:43:41 +02:00
frosch
c09e825e0b Codechange: Change SetDateCallback into a std::function, so there is no need for void* user data. 2025-04-18 22:43:41 +02:00
frosch
0d4588688f Codechange: Manage script event queue using smart pointers. 2025-04-18 19:47:28 +02:00
frosch
b9f4ef3d78 Codechange: Move ScriptStorage constructor into source file, so private members can have partially incomplete types. 2025-04-18 19:47:28 +02:00
frosch
af14809697
Codechange: Add filename and line number to errors/warnings of the squirrel-exporters. (#14031) 2025-04-18 19:43:32 +02:00
frosch
50252cb5df
Codechange: Ini(Load|Save)WindowSettings expect a WindowDesc*, no void*. (#14029) 2025-04-18 18:44:58 +02:00
Peter Nelson
394adb654e
Codechange: Move GUI parts of badges to a separate file. (#14023) 2025-04-18 17:20:31 +01:00
Peter Nelson
67d6089f39
Change: Don't replace stripped control codes with '?' for scripts. (#14028) 2025-04-18 17:20:08 +01:00
frosch
45917dbaa3 Codechange: Remove unused macro strncasecmp. 2025-04-18 17:16:48 +02:00
frosch
84e175ce63 Codechange: Determine array length using 'std::size' instead of using a separate constant. 2025-04-18 17:16:48 +02:00
frosch
7cbf4f5560 Codechange: Expand the single usage of the macro CLRBITS. 2025-04-18 17:16:48 +02:00
frosch
d97936e77a Codechange: Replace ALIGN macro with C++11 alignas specifier. 2025-04-18 17:16:48 +02:00
frosch
f82e172610 Codechange: Expand and remove DEF_CONSOLE_CMD and DEF_CONSOLE_HOOK macros. 2025-04-18 17:16:48 +02:00
frosch
42deccc4f5 Codechange: Merge (IsOn|Toggle)(Snow|Desert) into (IsOn|Toggle)SnowOrDesert. 2025-04-18 16:33:26 +02:00
frosch
252376ce3e Codechange: Rename DrawRoadAsSnowDesert to DrawRoadAsSnowOrDesert to be consistent with other functions. 2025-04-18 16:33:26 +02:00
frosch
26db4ccf09
Codechange: Turn bit-stuffed FiosType enum into a struct. (#14019) 2025-04-18 15:20:55 +02:00
frosch
b862d4937f
Codechange: Turn custom vehicle spritenums into enum, and use them consistently. (#14022) 2025-04-18 15:19:28 +02:00
Peter Nelson
2c59838acb
Codechange: (re)set multiple bitset flags in one call. (#14017) 2025-04-18 14:07:57 +01:00
frosch
31e716449d
Codechange: Change StationNameInformation to not use macros. (#14020) 2025-04-18 15:06:46 +02:00
frosch
5aed046d11
Fix: [NewGRF] Strange things happened, when using the synchronised tile loop animation trigger for houses. (#14011) 2025-04-17 12:15:49 +02:00
translators
421f202539 Update: Translations from eints
luxembourgish: 103 changes by phreeze83
latvian: 1 change by lexuslatvia
2025-04-17 04:45:26 +00:00
Peter Nelson
1f83ea41fc
Fix: [NewGRF] PrepareLayout worked on a copy of the data resulting in bad sprite layouts. (#14013) 2025-04-16 21:27:36 +00:00
Peter Nelson
378ea52ac6 Codechange: Use EnumBitSet for CzechChooseFlags. 2025-04-16 19:44:28 +01:00
Peter Nelson
ea0817390f Codechange: Use EnumBitSet for CzechAllowFlags. 2025-04-16 19:44:28 +01:00
Peter Nelson
6ea10edef8
Codechange: Use std::unique_ptrs for handling station cargo display. (#14009)
Replaces manual management of raw pointers.
2025-04-16 19:43:45 +01:00
Peter Nelson
a281ac4674 Codefix: Information for NewGRF specs remained duplicated after loading.
After loading airports+tiles, industries+tiles, houses and objects, their specs are copied from the NewGRF's loading storage to the final global storage.

Instead, move the specs to the their new storage, and clear the NewGRF's storage once done. (Stations and RoadStops are different, and the NewGRF's storage is the final storage location.)
2025-04-16 19:43:07 +01:00
Peter Nelson
f9ab492e64 Codechange: Pass HouseSpec by reference to IsHouseSpecValid(). 2025-04-16 19:43:07 +01:00
translators
b57f3262ec Update: Translations from eints
spanish: 101 changes by MontyMontana
2025-04-16 04:44:48 +00:00
Peter Nelson
fa0814e257
Codefix: Codestyle consistency fixes. (#14008) 2025-04-15 20:57:13 +00:00
frosch
03ed59a004 Codechange: Turn AnimationStatus into an enum class. 2025-04-15 20:42:44 +02:00
frosch
47f0f4dd9e Fix: [NewGRF] Animation speed properties of houses and stations had wrong default. 2025-04-15 20:42:44 +02:00
frosch
301b209b87
Fix: [NewGRF] Roadstop animation/randomisation was not triggered on vehicle arrival. (#14003) 2025-04-15 14:53:29 +02:00
translators
5fad689782 Update: Translations from eints
norwegian (bokmal): 1 change by eriksorngard
2025-04-15 04:44:48 +00:00
Peter Nelson
5008568dfc
Codechange: Rename CenterBounds to CentreBounds and move to geometry header. (#14002) 2025-04-14 23:55:40 +01:00
Michael Lutz
fc20ce301a
Doc: Missing changelog entry for 15.0-beta2. (#14001) 2025-04-14 18:50:02 +00:00
frosch
d2c9828b4c Codechange: Move IsUtf8Part to only file using it. 2025-04-14 18:56:23 +02:00
frosch
588fedb5db Codechange: Remove unused Utf8Consume, Utf8Decode, Utf8EncodedCharLen. 2025-04-14 18:56:23 +02:00
frosch
bf8a241f69 Codechange: Parse translation files using StringConsumer. 2025-04-14 18:10:14 +02:00
frosch
b27fd83ff1 Codechange: Parse translation strings using StringConsumer. 2025-04-14 18:10:14 +02:00
frosch
b81a35ea89 Codechange: Use StringConsumer and Builder in StrMakeValid and StrValid. 2025-04-14 18:07:23 +02:00
frosch
dc21fae18e Codechange: Add InPlaceReplacement to couple StringConsumer and Builder on the same buffer. 2025-04-14 18:07:23 +02:00
frosch
f5ffd4789b Codechange: Use StringConsumer in FormatString. 2025-04-14 16:57:41 +02:00
frosch
15a17d832f Codechange: Use StringConsumer in HandleNewGRFStringControlCodes. 2025-04-14 16:57:41 +02:00
frosch
98efd3c96e Codefix #13872: Use StringConsumer in TranslateTTDPatchCodes. 2025-04-14 16:57:41 +02:00
John Taylor
069edc1a4b
Fix #13954: Plotting graphs with limited data to the right. (#13956) 2025-04-14 16:57:07 +02:00
translators
3dacf46870 Update: Translations from eints
vietnamese: 7 changes by KhoiCanDev
2025-04-14 04:44:46 +00:00
Peter Nelson
d48bc18721
Codechange: Rename badge_class to class_index and badge_classes to gui_classes internally. (#13995)
These names are already used in some places, so this brings a bit of consistency.
2025-04-13 21:06:09 +01:00
frosch
131b7c7122 Codechange: Replace Utf8Decode usages with StringConsumer. 2025-04-13 21:59:10 +02:00
frosch
9bcd3feb17 Codechange: Make SQFile a buffered reader, based on StringConsumer. 2025-04-13 21:59:10 +02:00
frosch
3964d053b5 Codechange: Replace BufState with StringConsumer. 2025-04-13 21:59:10 +02:00
frosch
96eee0e8e4 Codechange: Base ByteReader on StringConsumer. 2025-04-13 21:59:10 +02:00
frosch
800d6e339d Codechange: Add StringConsumer. 2025-04-13 21:59:10 +02:00
Peter Nelson
4721a1f93e
Fix: Don't display badges if the class has no name. (#13994)
Unnamed badges are intended to be for internal-use, not for player information.

Additionally if there is no name to the class, then is causes problems when user configuration comes.
2025-04-13 18:00:41 +01:00
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
3347919fb2 Codechange: Remove empty destructor and use member init for ClientNetworkContentSocketHandler. 2025-04-11 23:08:59 +01:00
Peter Nelson
20d83677eb Codechange: Use unique_ptr to manage ContentInfo lifetime.
Removes manually managed new/delete.
2025-04-11 23:08:59 +01:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
c982816c0e Codechange: Manage window viewport via unique_ptr. 2025-04-09 22:03:23 +01:00
Peter Nelson
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
Peter Nelson
70b4beb8e7 Codechange: Return screenshot viewport instead of using out parameter. 2025-04-09 22:03:23 +01:00
Peter Nelson
f57065dd41 Codefix: Avoid using override keyword as variable names.
Rename variables named `override`.
2025-04-09 22:02:35 +01:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
e200e9b401
Codechange: Use EnumBitSet for Linkgraph RefreshFlags. (#13930) 2025-03-31 20:33:32 +01:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
0829604b4f
Fix #13908: Require double click on order to change stop location. (#13913) 2025-03-28 20:23:18 +00:00
Peter Nelson
e49150f9ca
Fix #13910: Invalidate content of house picker window if language is changed. (#13911) 2025-03-28 19:57:43 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
3375dc3095 Codechange: Use traits to define BaseSet parameters. 2025-03-27 18:57:53 +00:00
Peter Nelson
6914d99778 Codechange: Split baseset type definitions into separate files. 2025-03-27 18:57:53 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
325f7f9767
Codechange: Use EnumBitSet for GoodsEntry status. (#13899) 2025-03-26 21:22:33 +00:00
Peter Nelson
5331389765
Codechange: Pass NewsItem by reference. (#13898) 2025-03-26 18:56:33 +00:00
Peter Nelson
422ff9dbd8 Codechange: Use std::unique_ptr for ai/game config. 2025-03-26 10:54:11 +00:00
Peter Nelson
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
Peter Nelson
fb008436b8
Codechange: Use std::unique_ptr for script info/library instances. (#13892) 2025-03-25 21:07:02 +00:00
Peter Nelson
47d078c033 Codechange: Use EnumBitSet for RailTypes. 2025-03-25 20:15:48 +00:00
Peter Nelson
732109e444 Codechange: Use EnumBitSet for RoadTypes. 2025-03-25 20:15:48 +00:00
Peter Nelson
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
Peter Nelson
93016b9a92
Fix #13842: Close industry production graph if industry is removed. (#13890) 2025-03-25 17:58:59 +00:00
Peter Nelson
9f94cadd68
Codefix: GRF-local cargo id is not a CargoType. (#13888) 2025-03-25 17:12:43 +00:00
Peter Nelson
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
Peter Nelson
79ef4e98fe
Codechange: Use std::swap() instead of Swap() (#13883) 2025-03-24 23:47:34 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
234c9fb3bd Codechange: Use EnumBitSet for SpriteFlags. 2025-03-23 18:01:02 +00:00
Peter Nelson
5abe7c1386 Codechange: Use default initialisation for 32bpp_sse2's SpriteData.
Avoids using memset.
2025-03-23 18:01:02 +00:00
Peter Nelson
828e808444 Codechange: Split NewGRF loader into separate Action handlers. 2025-03-23 16:59:36 +00:00
Peter Nelson
0b7fa11a5b Codechange: Move NewGRF string mapping to own file. 2025-03-23 16:59:36 +00:00
Peter Nelson
2cb389946d Codechange: Move GrfProcessingState to separate file.
Allows reuse by other files.
2025-03-23 16:59:36 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
a4f9977d18
Codechange: Don't reimplement DistanceManhattan. (#13850) 2025-03-21 17:06:39 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
762e2f76a3 Codechange: Avoid STR_NULL in header file. 2025-03-21 12:53:40 +00:00
Peter Nelson
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
Peter Nelson
89948b941b
Codechange: Use emplace_back instead of push_back. (#13855) 2025-03-20 17:39:10 +00:00
Peter Nelson
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
Peter Nelson
17f7d0950e
Fix #13838: Formatted error message of sub-errors may be lost. (#13840) 2025-03-18 08:39:40 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
62b8b93476 Codechange: Add default initialisation for Rect to remove MemSetT. 2025-03-15 20:09:38 +00:00
Peter Nelson
c905472650 Codechange: Use std::array for vehicle sorting/grouping options to remove MemSetT. 2025-03-15 20:09:38 +00:00
Peter Nelson
653e886d26 Codechange: Use std::array in OpenGLSprite to remove MemSetT. 2025-03-15 20:09:38 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
3eb89f04b5
Codechange: Use EnumBitSet for QueryStringFlags. (#13792) 2025-03-10 18:59:35 +00:00
Peter Nelson
1a53b48422
Codechange: Use EnumBitSet for PartsOfSubsidy. (#13791) 2025-03-10 18:59:21 +00:00
Peter Nelson
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
Peter Nelson
7c97460080
Codechange: Use EnumBitSet for ConsistChangeFlags. (#13788) 2025-03-09 21:13:57 +00:00
Peter Nelson
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
Peter Nelson
52bada216c Codechange: Use std::array for vehicle hashes.
This allows initialisation without memset.
2025-03-09 18:03:50 +00:00
Peter Nelson
ec71f7a216 Codechange: Use std::array for temporary NewGRF loading data.
This allows initialisation without memset.
2025-03-09 18:03:50 +00:00
Peter Nelson
761c587940 Codechange: Use std::array to store most-used railtype.
This allows initialisation without memset.
2025-03-09 18:03:50 +00:00
Peter Nelson
61aa45071a
Codechange: Use EnumBitSet for SigFlags. (#13784) 2025-03-09 18:01:52 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
794317e870
Fix #13758: Owned by error message consumed too many parameters. (#13762) 2025-03-07 23:36:18 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
274b7a0195
Fix #13645: "Follow vehicle" button not raised when following stopped. (#13746) 2025-03-06 00:00:57 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
b979f0414c Codechange: Prevent nested encoded strings. 2025-03-04 21:40:39 +00:00
Peter Nelson
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
Peter Nelson
2a05a845df Feature: Snow-covered rocks are now visible. 2025-03-04 20:39:08 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
e818fcbf19 Codechange: Allow encoded strings to use as many parameters as necessary. 2025-03-04 08:48:35 +00:00
Peter Nelson
37b276b4b5 Cleanup: Remove STR_JUST_STRING2/4. 2025-03-04 08:23:28 +00:00
Peter Nelson
a1bcfb836a Codechange: Remove leftover SetStringTips. 2025-03-04 08:23:28 +00:00
Peter Nelson
e10e96b9d5 Codechange: Drop default widget strings for autoreplace window. 2025-03-04 08:23:28 +00:00
Peter Nelson
3d95a7813f Codechange: Drop default widget strings for AI config window. 2025-03-04 08:23:28 +00:00
Peter Nelson
ab0d6e8b95 Codechange: Drop default widget strings for network windows. 2025-03-04 08:23:28 +00:00
Peter Nelson
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
Peter Nelson
4e485cd083
Fix: Network relay question used string parameters unconventionally. (#13734) 2025-03-04 00:25:15 +00:00
Peter Nelson
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
Peter Nelson
aec1046d19 Codechange: Drop default widget strings for goal window. 2025-03-03 22:47:07 +00:00
Peter Nelson
3757d8affe Codechange: Drop default widget strings for league window. 2025-03-03 22:47:07 +00:00
Peter Nelson
d587426912 Codechange: Drop default widget strings for story window. 2025-03-03 22:47:07 +00:00
Peter Nelson
c7d6934816 Codechange: Move to GetWidgetString for town windows. 2025-03-03 22:34:22 +00:00
Peter Nelson
92e4ef7e77 Codechange: Move to GetWidgetString for toolbar windows. 2025-03-03 22:34:22 +00:00
Peter Nelson
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
Peter Nelson
92b723cb4e
Fix #13723: Invalid string parameters for build airport window. (#13724) 2025-03-03 22:17:54 +00:00
Peter Nelson
94c6221dff
Fix edf9f597ec: Screenshot with non-wallclock date saved with wrong filename. (#13721) 2025-03-03 21:44:48 +00:00
Peter Nelson
deb3755acb Codechange: Move to GetWidgetString for waypoint window. 2025-03-03 21:24:18 +00:00
Peter Nelson
a65db3be0d Codechange: Move to GetWidgetString for viewport window. 2025-03-03 21:24:18 +00:00
Peter Nelson
e1f9159b51 Codechange: Move to GetWidgetString for vehicle windows. 2025-03-03 21:24:18 +00:00
Peter Nelson
d58eb15a0f Fix #13706, Fix #13717: Replace single new line with double new line in precomposed errors. 2025-03-03 21:23:45 +00:00
Peter Nelson
92fa1b4444 Codechange: Move to GetWidgetString for station windows. 2025-03-03 21:23:13 +00:00
Peter Nelson
09806d6f9b Codechange: Move to GetWidgetString for smallmap window. 2025-03-03 21:23:13 +00:00
Peter Nelson
8f62e40bc7 Codechange: Move to GetWidgetString for sign windows. 2025-03-03 21:23:13 +00:00
Peter Nelson
3d253a9702 Codechange: Move to GetWidgetString for settings windows. 2025-03-03 21:23:13 +00:00
Peter Nelson
7a9a3ef94a Codechange: Move to GetWidgetString for script windows. 2025-03-03 21:23:13 +00:00
Peter Nelson
c7846f4629 Codechange: Move to GetWidgetString for road windows. 2025-03-03 21:20:14 +00:00
Peter Nelson
039b5a2662 Codechange: Move to GetWidgetString for rail windows. 2025-03-03 21:20:14 +00:00
Peter Nelson
ee07790a87 Codechange: Move to GetWidgetString for osk window. 2025-03-03 21:19:44 +00:00
Peter Nelson
06b2751b11 Codechange: Move to GetWidgetString for orders window. 2025-03-03 21:19:44 +00:00
Peter Nelson
6e0e46fd69 Codechange: Move to GetWidgetString for object window. 2025-03-03 21:19:44 +00:00
Peter Nelson
f6bc85aeb2 Codechange: Move to GetWidgetString for news windows. 2025-03-03 21:19:44 +00:00
Peter Nelson
3fbd6f776c Codechange: Move to GetWidgetString for newgrf windows. 2025-03-03 21:19:44 +00:00
Peter Nelson
6d1d320a7d Codechange: Move to GetWidgetString for music window. 2025-03-03 20:54:48 +00:00
Peter Nelson
7e43106a92 Codechange: Move to GetWidgetString for misc windows. 2025-03-03 20:54:48 +00:00
Peter Nelson
997b013e6b Codechange: Move to GetWidgetString for industry window. 2025-03-03 20:54:48 +00:00
Peter Nelson
a22b150c98 Codechange: Move to GetWidgetString for group window. 2025-03-03 20:54:09 +00:00
Peter Nelson
015c081cea Codechange: Move to GetWidgetString for graph window. 2025-03-03 20:54:09 +00:00
Peter Nelson
e959dcd49d Codechange: Move to GetWidgetString for world gen windows. 2025-03-03 20:54:09 +00:00
Peter Nelson
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
Peter Nelson
bb91113186 Codechange: Move to GetWidgetString for framerate window. 2025-03-03 08:53:14 +00:00
Peter Nelson
d7ccd6a413 Codechange: Move to GetWidgetString for error window. 2025-03-03 08:53:14 +00:00
Peter Nelson
16d985efe0 Codechange: Move to GetWidgetString for depot window. 2025-03-03 08:53:14 +00:00
Peter Nelson
d061c1293b Codechange: Move to GetWidgetString for date window. 2025-03-03 08:53:14 +00:00
Peter Nelson
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
Peter Nelson
a2accbccc3
Fix #13703: Don't set error owner for town-originated errors. (#13705) 2025-03-02 21:59:55 +00:00
Peter Nelson
712ed867b2
Codechange: Move to GetWidgetString for company windows. (#13704) 2025-03-02 21:45:17 +00:00
Peter Nelson
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
Peter Nelson
e9609e4558
Codechange: Use GetWidgetString for network windows. (#13699) 2025-03-02 18:51:54 +00:00
Peter Nelson
2f75f3d147
Codechange: Use GetWidgetString for goal, league and story windows. (#13700) 2025-03-02 18:33:11 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
edf9f597ec Codechange: Use parameterised GetString() for remaining windows. 2025-03-02 07:29:25 +00:00
Peter Nelson
4889e4d7f1 Codechange: Use parameterised GetString() for statusbar. 2025-03-02 07:29:25 +00:00
Peter Nelson
3fda5a8a58 Codechange: Use parameterised GetString() for jukebox window. 2025-03-02 07:29:25 +00:00
Peter Nelson
5f073670d7 Codechange: Use parameterised GetString() for news window. 2025-03-02 07:29:25 +00:00
Peter Nelson
937fb12d9a Codechange: Use parameterised GetString() for file windows. 2025-03-02 07:29:25 +00:00
Peter Nelson
4389321623 Codechange: Use parameterised GetString() for cheat window. 2025-03-02 07:29:25 +00:00
Peter Nelson
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
Peter Nelson
9d7d24465d
Codechange: Use parameterised GetString() for group window. (#13693) 2025-03-01 23:42:01 +00:00
Peter Nelson
78aebfc693
Codechange: Use parameterised GetString() for station view. (#13692) 2025-03-01 23:04:51 +00:00
Peter Nelson
600450f8a4
Codechange: Use parameterised GetString() for depot window. (#13691) 2025-03-01 22:27:40 +00:00
Peter Nelson
2aa99a70ff
Codechange: Use parameterised GetString() for company windows. (#13690) 2025-03-01 22:25:11 +00:00
Peter Nelson
8216938276
Codechange: Use parameterised GetString() for world generation window. (#13689) 2025-03-01 22:18:36 +00:00
Peter Nelson
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
Peter Nelson
170002ff7e
Codechange: Use parameterised GetString() for industry window. (#13685) 2025-03-01 19:59:43 +00:00
Peter Nelson
b92172e3d2
Codechange: Use parameterised GetString() for smallmap window. (#13684) 2025-03-01 18:24:14 +00:00
Peter Nelson
1bd841b896
Codechange: Use parameterised GetString() for graph windows. (#13683) 2025-03-01 17:22:18 +00:00
Peter Nelson
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
Peter Nelson
c81d9b43ea
Codechange: Use parameterised GetString() for town windows. (#13679) 2025-03-01 13:20:05 +00:00
Peter Nelson
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
Peter Nelson
6d2f17b92f
Codechange: Use parameterised GetString() for various build windows. (#13676) 2025-03-01 11:08:46 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
ddb502d097
Codechange: Use parameterised GetString() for script-related windows. (#13671) 2025-02-27 23:53:04 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
31bd85b743
Codechange: Use parameterised GetString() for goal, league and story windows. (#13662) 2025-02-25 22:55:06 +00:00
Peter Nelson
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
Peter Nelson
f1b683b372 Change: Show the type of land covered by snow. 2025-02-25 08:22:46 +00:00
Peter Nelson
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
Peter Nelson
96f260e718 Codechange: Pass TileDesc by reference. 2025-02-23 23:00:51 +00:00
Peter Nelson
012daaa3d9 Codechange: Use member initialisation for TileDesc members. 2025-02-23 23:00:51 +00:00
Peter Nelson
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
Peter Nelson
1b6a77a190 Codechange: Update translations for parameter changes. 2025-02-23 13:52:13 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
b13922fb48 Codechange: Update translations for parameter position changes. 2025-02-22 10:33:22 +00:00
Peter Nelson
24d327a30b Codechange: Use parameterised-GetString for vehicle related windows. 2025-02-22 10:33:22 +00:00
Peter Nelson
0428f8c667 Codechange: Add AppendStringWithArgsInPlace() function. 2025-02-22 10:33:22 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
f4b1bd30f2 Codechange: Codestyle changes for Script League table window. 2025-02-20 22:41:50 +00:00
Peter Nelson
17a4fcefde Fix: League table window ignored the minimal size in its widget description. 2025-02-20 22:41:50 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
370c702549
Add: Show badges in NewGRF debug window. (#13597) 2025-02-17 22:15:45 +00:00
Peter Nelson
7a23bfa747
Add: Filter purchase lists by badge text. (#13588) 2025-02-17 17:28:26 +00:00
Peter Nelson
5e43aaff35
Add: Also show badges in fund industry list. (#13590) 2025-02-17 17:27:57 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
13944222f3
Fix d13b0e0813: "New vehicle now available!" message is wrong colour. (#13586) 2025-02-16 23:00:24 +00:00
Peter Nelson
8f14894024 Add: NewGRF Badges. 2025-02-16 22:24:25 +00:00
Peter Nelson
ca3b5ed6c1 Codechange: Allow iterating a BaseBitSet. 2025-02-16 22:24:25 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
2d7d085e8e
Codechange: Use EncodedString for error messages. (#13569) 2025-02-16 10:04:32 +00:00
Peter Nelson
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
Peter Nelson
cb23bc5e2a
Add: Show cargo types produced by building in house picker. (#13561) 2025-02-15 15:06:58 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
f309b90a1d Codechange: Use EnumBitSet for Airport blocks. 2025-02-13 22:02:02 +00:00
Peter Nelson
9049710051 Codechange: Allow (Re)setting a range of values in a BaseBitSet. 2025-02-13 22:02:02 +00:00
Peter Nelson
f0777737af Fix #13459, Fix #13546: Crash when changing NewGRFs in game with picker window open. 2025-02-13 21:07:37 +00:00
Peter Nelson
71dafdb21e Codechange: Use EnumBitSet for picker window invalidation flags. 2025-02-13 21:07:37 +00:00
Peter Nelson
75387b9e2b Codechange: Use EnumBitSet for StationFacility. 2025-02-13 18:03:13 +00:00
Peter Nelson
8d38308ebb Codechange: Allow ConvertibleThroughBase to be used as One/ManyOfManySetting. 2025-02-13 18:03:13 +00:00
Peter Nelson
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
Peter Nelson
1d04d4027a
Codechange: Use EnumBitSet for SettingEntryFlags. (#13534) 2025-02-11 22:18:06 +00:00
Peter Nelson
0d5708ba86
Codechange: Use EnumBitSet for AirportFTAClass::Flags (#13535) 2025-02-11 21:49:18 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
7c1898eaf1 Codechange: Store EncodedString for text effects.
This replaces capturing and storing string parameters.
2025-02-10 22:49:14 +00:00
Peter Nelson
2cb9f55183 Codechange: Store EncodedString for tooltip text.
This replaces capturing and storing string parameters.
2025-02-10 22:49:14 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
0c0e7606d9
Codechange: Use unique_ptr for UDP client/server sockets handlers. (#13524) 2025-02-10 22:41:56 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
11bfd5bb9e
Codechange: Use EnumBitSet for EndSegmentReasons. (#13490) 2025-02-07 23:53:23 +00:00
Peter Nelson
50b384032d Codechange: Use EnumBitSet for IndustryControlFlags. 2025-02-07 22:01:59 +00:00
Peter Nelson
965a45812a Codechange: Allow masking invalid values passed to EnumBitSet. 2025-02-07 22:01:59 +00:00
Peter Nelson
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
Peter Nelson
d9bb002cac
Codechange: Use local parameters for formatting settings values. (#13487) 2025-02-07 20:18:03 +00:00
Peter Nelson
9a6fc4eb76 Codechange: Use enum class for NewsReferenceType. 2025-02-07 19:36:52 +00:00
Peter Nelson
ca75a8ce19 Codechange: Use enum class for NewsType. 2025-02-07 19:36:52 +00:00
Peter Nelson
4fd1929bf7 Codechange: Use EnumBitSet for NewsFlags. 2025-02-07 19:36:52 +00:00
Peter Nelson
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
Peter Nelson
99a32207b8
Codechange: Use preformatted strings for slider marks. (#13484) 2025-02-07 18:14:53 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
fb70a7fe7e Codechange: Use EnumBitSet for IndustryTileSpecialFlags. 2025-02-07 12:30:06 +00:00
Peter Nelson
1916454776 Codechange: Use EnumBitSet for IndustryLifeTypes. 2025-02-07 12:30:06 +00:00
Peter Nelson
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
Peter Nelson
693a5f42b9 Codechange: Use EnumBitSet for NWidgetDisplayFlags. 2025-02-06 19:43:35 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
c31494a413 Codechange: Use EnumBitSet for RoadStopDrawModes. 2025-02-04 18:52:08 +00:00
Peter Nelson
17f6da413d Codechange: Use EnumBitSet for RoadStopSpecFlags. 2025-02-04 18:52:08 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
6f52a977a8 Codechange: Use EnumBitSet for GRFConfigFlags.
This is renamed from `GCF_Flag` didn't match convention.
2025-02-02 10:49:45 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
c4c5028862
Codechange: Use EnumBitSet for SettingFlags. (#13429) 2025-02-01 15:46:51 +00:00
Peter Nelson
1d25c526b4
Codechange: Use EnumBitSet for strgen's CmdFlags. (#13428) 2025-02-01 15:45:55 +00:00
Peter Nelson
95bd53ddf1 Codechange: Use EnumBitSet for BuildingFlags. 2025-02-01 14:16:25 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
f8b1e3033f Codechange: Use EnumBitSet for EngineFlags. 2025-01-31 18:55:31 +00:00
Peter Nelson
6c4ddb242a Codechange: Use EnumBitSet for EngineMiscFlags. 2025-01-31 18:55:31 +00:00
Peter Nelson
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
Peter Nelson
40aeedeade Codechange: Use EnumBitSet for callback masks. 2025-01-31 17:08:24 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
56b1e9df1f Codechange: Use EnumBitSet for FrameFlags. 2025-01-30 08:40:42 +00:00
Peter Nelson
d30e8dd1c1 Codechange: Use EnumBitSet for WindowDefaultFlags. 2025-01-30 08:40:42 +00:00
Peter Nelson
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
Peter Nelson
f51627c76f Codechange: Use EnumBitSet for DepotCommand(Flag)s. 2025-01-29 21:46:39 +00:00
Peter Nelson
2560339472 Codechange: Use EnumBitSet for Border(Flag)s. 2025-01-29 21:46:39 +00:00
Peter Nelson
473728f181 Codechange: Use EnumBitSet for ExtraEngineFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
cea62a8399 Codechange: Use EnumBitSet for AspectFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
5ef495da78 Codechange: Use EnumBitSet for GroupFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
4b573b2703 Codechange: Use EnumBitSet for ViewportStringFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
05ac1dd888 Codechange: Use EnumBitSet for TileFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
3c2706f859 Codechange: Use EnumBitSet for EngineDisplayFlags. 2025-01-29 21:46:39 +00:00
Peter Nelson
6d1f56ce6b Codechange: Allow using EnumBitSet over network commands. 2025-01-29 21:46:39 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
afc0745aa2
Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
Peter Nelson
6fda85c569 Cleanup: Remove CMake endian detection. 2025-01-28 19:37:34 +00:00
Peter Nelson
fb6781015a Codechange: Use std::endian instead of TTD_ENDIAN defines. 2025-01-28 19:37:34 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
1e14fd6a0d Codechange: Use enum class for PaletteAnimation. 2025-01-25 21:42:21 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
3a50b24a8d
Codechange: Replace macros in TGP. (#13346)
Remove use of Amplitude as a percentage.
2025-01-22 07:27:41 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
c5d3ac7a71 Codechange: Move colour brightness methods to palette code.
This allows reuse outside of blitters.
2025-01-21 00:45:31 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
5f0e4cd646
Codechange: Make RoadStopType an enum class. (#13340) 2025-01-19 21:43:17 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
4c8f1b0f81
Add: Ability to toggle visibility of station signs by facility. (#13207) 2025-01-14 21:23:35 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
c0edbe0d37
Change: Remove support for SDL1.2. (#13298)
Our SDL2 driver is now 5 years old.
2025-01-09 20:43:52 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
d7235dc765
Codefix: Script's last_error is not a StringID. (#13227) 2025-01-01 21:35:41 +00:00
Peter Nelson
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
Peter Nelson
448d6ede4a
Codechange: Use STR_NULL (or {}) instead of literal 0. (#13222) 2025-01-01 20:17:20 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
Peter Nelson
74087e6a2e Codechange: Use _TOOLTIP suffix for other tooltip StringIDs. 2025-01-01 02:28:08 +00:00
Peter Nelson
1ba0598a2c Codechange: Use _TOOLTIP suffix for scenario editor toolbar tooltip StringIDs. 2025-01-01 02:28:08 +00:00
Peter Nelson
ad26b1e8b1 Codechange: Use _TOOLTIP suffix for custom face tooltip StringIDs. 2025-01-01 02:28:08 +00:00
Peter Nelson
dba02edfa3 Codechange: Use _TOOLTIP suffix for depot tooltip StringIDs. 2025-01-01 02:28:08 +00:00
Peter Nelson
806831af46 Codechange: Use _TOOLTIP suffix for genworld tooltip StringIDs. 2025-01-01 02:28:08 +00:00
Peter Nelson
0e1002bca6 Codechange: Use _TOOLTIP instead of _TT suffix for tooltip StringIDs. 2025-01-01 02:28:08 +00:00
Peter Nelson
6b931667c9 Codechange: Use _TOOLTIP suffix fot replace vehicle tooltip StringIDs. 2025-01-01 02:28:08 +00:00
Peter Nelson
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
Peter Nelson
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
Peter Nelson
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
1289 changed files with 82298 additions and 73259 deletions

View File

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

36
.github/changelog.py vendored 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.md | 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.md | 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

@ -158,7 +158,7 @@ def scan_source_files(path, strings_found):
# Most files we can just open, but some use magic, that requires the
# G++ preprocessor before we can make sense out of it.
if new_path == "src/table/cargo_const.h":
p = subprocess.run(["g++", "-E", new_path], stdout=subprocess.PIPE)
p = subprocess.run(["g++", "-E", "-DCHECK_UNUSED_STRINGS", new_path], stdout=subprocess.PIPE)
output = p.stdout.decode()
else:
with open(new_path) as fp:

View File

@ -12,7 +12,8 @@ jobs:
runs-on: ubuntu-latest
container:
# If you change this version, change the number in the cache step too.
# 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:
@ -23,9 +24,18 @@ jobs:
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 }}

View File

@ -9,27 +9,6 @@ env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
linux:
strategy:
fail-fast: false
matrix:
include:
- name: GCC - SDL1.2
compiler: gcc
cxxcompiler: g++
libraries: libsdl1.2-dev
name: Linux (${{ matrix.name }})
uses: ./.github/workflows/ci-linux.yml
secrets: inherit
with:
compiler: ${{ matrix.compiler }}
cxxcompiler: ${{ matrix.cxxcompiler }}
libraries: ${{ matrix.libraries }}
extra-cmake-parameters:
macos:
strategy:
fail-fast: false
@ -69,7 +48,6 @@ jobs:
check_annotations:
name: Check Annotations
needs:
- linux
- macos
- mingw

View File

@ -87,6 +87,7 @@ jobs:
with:
languages: cpp
config-file: ./.github/codeql/codeql-config.yml
trap-caching: false
- name: Build
run: |

View File

@ -20,7 +20,8 @@ jobs:
runs-on: ubuntu-latest
container:
# If you change this version, change the number in the cache step too.
# 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:
@ -34,10 +35,19 @@ jobs:
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git checkout -b pr${{ github.event.pull_request.number }}
- name: Update to modern GCC
run: |
apt-get update
apt-get install -y gcc-12 g++-12
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100
- name: Setup cache
uses: actions/cache@v4
with:
path: /emsdk/upstream/emscripten/cache
# If you change this version, change the numbers in the image configuration step,
# .github/workflows/ci-emscripten.yml (2x) and os/emscripten/Dockerfile too.
key: 3.1.57-${{ runner.os }}
- name: Add liblzma support

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

@ -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

View File

@ -86,7 +86,7 @@ jobs:
echo "::endgroup::"
- name: Import code signing certificates
uses: Apple-Actions/import-codesign-certs@v3
uses: Apple-Actions/import-codesign-certs@v5
with:
# The certificates in a PKCS12 file encoded as a base64 string
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}

View File

@ -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,6 +126,13 @@ 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

View File

@ -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
@ -76,7 +77,7 @@ jobs:
curl -L https://cdn.openttd.org/openmsx-releases/0.4.2/openmsx-0.4.2-all.zip -o openmsx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
echo "::group::Unpack OpenMSX"
unzip openmsx-all.zip
tar xf openmsx-*.tar
echo "::endgroup::"

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.17)
if(NOT BINARY_NAME)
set(BINARY_NAME openttd)
@ -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,18 +132,17 @@ 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)
@ -177,7 +173,6 @@ if(MSVC)
endif()
find_package(SSE)
find_package(Xaudio2)
find_package(Grfcodec)
@ -187,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")
@ -236,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)
@ -267,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)
@ -306,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)
@ -320,12 +313,11 @@ 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)
@ -398,6 +390,7 @@ if(EMSCRIPTEN)
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()
{
@ -292,7 +294,6 @@ OpenTTD used to vertically-align inline Doxygen comments as shown above. OpenTTD
* 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.

View File

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

View File

@ -310,7 +310,7 @@ INCLUDE_FILE_PATTERNS =
PREDEFINED = WITH_ZLIB \
WITH_LZO \
WITH_LIBLZMA \
WITH_SDL \
WITH_SDL2 \
WITH_PNG \
WITH_FONTCONFIG \
WITH_FREETYPE \

View File

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

View File

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

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

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

View File

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

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

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

View File

@ -1,6 +0,0 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/

View File

@ -1,5 +1,108 @@
## 15.x
### 15.0-beta2 (2025-04-13)
- Feature: Snow-covered rocks are now visible (#13627)
- Feature: Generate more rocks on steep slopes during map generation or heightmap import (#13462)
- Feature: Prevent towns from upgrading individually-placed houses (#13270)
- Feature: [Win32] Touchpad two-finger map scrolling (#13172)
- Feature: NewGRF Badges (#13073)
- Add: [NewGRF] Add road-/tram-/rail-type variable 0x45 to get mutual road-/tram-/rail-type on same tile (#13934)
- Add: [Script] Newer Cargo Classes (#13779)
- Add: Show hyperlink destination tooltips in text window (#13742)
- Add: [Script] Saving/loading ScriptList (#13556)
- Add: Press Ctrl to build diagonal canals in game mode (#13432)
- Add: Sandbox settings to Sandbox Options window (#13268)
- Add: Setting to allow placing houses manually in-game (#13266)
- Add: [Script] Event for when a company's president name changes (#13208)
- Add: Ability to toggle visibility of station signs by facility (#13207)
- Add: [Script] ScriptEventCompanyRename (#12878)
- Add: Ukrainian Hryvnia currency (#12877)
- Add: Convert 32bpp-only sprites to 8bpp when needed (#11602)
- Change: [Script] Start GS (but don't run it) when generating world in scenario editor (#13961)
- Change: [Script] Add vehicle owner to crash event (#13878)
- Change: Make tree placement at world generation look more organic (#13515)
- Change: [MacOS] Put the icon in a rounded rectangle (#13446)
- Change: [Script] GetWaypointID to return the StationID of any waypoint (#13407)
- Change: Draw company manager face jacket after collar (#13390)
- Change: Don't distinguish between bus and truck stops when removing them (#13384)
- Change: [Script] Rename BridgeID to BridgeType in the script API (#13352)
- Change: Add fonts document to help window (#13305)
- Change: Log changes to sandbox settings (#13267)
- Change: When player joins network company, use its name instead of number in chat (#13263)
- Change: [Win32] Draw window title bar according to current Windows light/dark theme (#13196)
- Change: Restore wider spacers in main toolbars (#12039)
- Fix: NewGRF Global variables 0D, 0E and 1E refer to wrong GRFFile (#13986)
- Fix #13980: Allow diagonal selection for road convert (#13983)
- Fix: Validate raw strings from game-scripts, and strip invalid and control characters (#13976)
- Fix: Capitalise "Disabled" for the "maximum non-sticky open windows" setting (#13975)
- Fix: Frame widget with label had incorrect spacing (#13967)
- Fix: StringFilter included quotes in the search and failed (#13965)
- Fix #13955: Make graphs respect RTL (#13957)
- Fix: Numbers were left-aligned for RTL languages in several windows (#13959)
- Fix: MayHaveRoad claimed rail station tiles had road, so the custom stationspec index would be read as roadtype (#13949)
- Fix: [Script] Prevent cloning of API instances (#13947)
- Fix: Reference to the correct section of the README, if a graphics or a sound set is incomplete (#13946)
- Fix: Draw the bevel around the music track name as inset (#13935)
- Fix #13923: Padding in music GUI was asymmetric, so it looked different for LTR and RTL languages (#13933)
- Fix #13928: BuildOilRig did not properly set airport rotation (#13929)
- Fix: SDL2 application name hint was not effective (#13926)
- Fix #13921: [Win32] Don't try close an already closed event handle during destruction (#13924)
- Fix #13921: Don't reject MIDI files with a valid file magic value (#13924)
- Fix #13912: Multitile buildings break apart in house picker (#13914)
- Fix #13908: Require double click on order to change stop location (#13913)
- Fix #13910: Invalidate content of house picker window if language is changed (#13911)
- Fix: [Script] Reset instance when changing running scripts in scenario editor (#13906)
- Fix: [Script] Only run the gamescript GameLoop() in-game (#13896)
- Fix #13893: Reversed all x-axis labels for company related and industry production graphs in wallclock mode (#13894)
- Fix #13842: Close industry production graph if industry is removed (#13890)
- Fix #11528: Starting autorail dragging from existing track tiles resulted in adding non-continuous tracks (#13885)
- Fix: Autoreplace rail/road list only listed buildable types (#13887)
- Fix: [NewGRF] Display an error, if NewGRF reference out-of-bounds string parameters in gender/plural choices (#13881)
- Fix #13849: Settings in old saves could be overridden by defaults (#13874)
- Fix #13562: Removed cost estimation message from money cheat (#13857)
- Fix: [NewGRF] Plurals and genders did not work in strings with cases or substrings (#13853, #13852)
- Fix: [NewGRF] String parameter stack and case selection were not processed for control code 0x81 (#13851)
- Fix #13839: Incorrect colour of first company legend in smallmap window (#13841)
- Fix: i circumflex width in TrueType small font (#13836)
- Fix: Don't show owner of non-existent road (#13824)
- Fix: Error message window timeout doesn't match setting (#13812)
- Fix #13795: Crash in vehicle list of 32-bit platforms (#13796)
- Fix: [Script] Company rename event sometimes had the wrong name (#13794)
- Fix: Improve manager face randomisation (#13776)
- Fix #13740: [Script] Handle implicit orders for jump orders (#13753)
- Fix #13749: Default service intervals were not updated when changing timekeeping unit (#13751)
- Fix #13725: Use proper query strings for changing timetable values (#13737)
- Fix #11226: Don't draw story page elements that won't be visible (#13736)
- Fix: More AI than max_no_competitors could start with competitors_interval=0 (#13670)
- Fix: League table window ignored the minimal size in its widget description (#13629)
- Fix: Incorrect snow density when making rocks snowy (#13626)
- Fix: NewGRF vehicles display loading sprites when not actually loading or unloading (#13554)
- Fix #12925: Prevent cost estimates for settings changes (#13550)
- Fix: [Script] Report errors happening during 'Load()' (#13537)
- Fix: [Script] Improve type checking of parameters (#13522)
- Fix: [Script] Don't set CommandCallback for asynchronous commands (#13501)
- Fix: Missing error messages with sell- and autoreplace-all commands (#13469)
- Fix: Too many trees when generating trees at same height (#13460)
- Fix #12912: Company inaugurated year in wallclock mode was not saved (#13448)
- Fix: [Script] Wrong return value for failed preconditions Vehicle::CloneVehicle (#13445)
- Fix #13140: Scale initial industry production estimate by cargo scale (#13427)
- Fix #13384: Crash when remove bus/truck stop tool used on road waypoints (#13391)
- Fix #12987: Historical houses now always spawn completed (#13332)
- Fix: [Win32] Font detection didn't work for locales not supporting code pages (#13306)
- Fix: Restore ability to disable service interval (#13281)
- Fix: Hide company settings from console commands (#13269)
- Fix: Disable service interval widgets for non-owned vehicles (#13260)
- Fix #13225: Cargo payment graph key toggled wrong data sets (#13226)
- Fix: Rail station tile flags were not set early enough (#13203)
- Fix #13199: -f command line parameter does not need a value (#13200)
- Fix: Missing water region invalidation after flooding a half tile with rail in the highest corner (#13047)
- Fix: Strip control codes before sorting NewGRF names (#13034)
- Fix #12968: Added back ability to create unremovable houses (#12989)
- Remove: Drop support for UCS2/UTF-16 encoded scripts (#13992)
- Remove: Support for SDL1.2 (#13298)
### 15.0-beta1 (2024-12-24)
- Feature: Town, industry and vehicle window zoom with mouse wheel (#12810, #12809, #12797)

View File

@ -80,6 +80,10 @@ macro(compile_flags)
# We use 'ABCD' multichar for SaveLoad chunks identifiers
-Wno-multichar
# Prevent optimisation supposing enums are in a range specified by the standard
# For details, see http://gcc.gnu.org/PR43680 and PR#5246.
-fno-strict-enums
)
# 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})

View File

@ -4,6 +4,9 @@ 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")
@ -33,5 +36,6 @@ if (Ogg_FOUND)
INTERFACE_LINK_LIBRARIES "${Ogg_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${Ogg_LINK_FLAGS}"
)
FixVcpkgTarget(Ogg Ogg::ogg)
endif()
endif()

View File

@ -4,6 +4,9 @@ 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")
@ -33,5 +36,6 @@ if (Opus_FOUND)
INTERFACE_LINK_LIBRARIES "${Opus_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${Opus_LINK_FLAGS}"
)
FixVcpkgTarget(Opus Opus::opus)
endif()
endif()

View File

@ -4,6 +4,9 @@ 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")
@ -36,5 +39,6 @@ if (OpusFile_FOUND)
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

@ -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

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.16)
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.16)
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.16)
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.16)
cmake_minimum_required(VERSION 3.17)
if(NOT REV_MAJOR)
set(REV_MAJOR 0)

View File

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

View File

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

View File

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

View File

@ -223,7 +223,7 @@ Last updated: 2024-03-26
## 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

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

@ -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,7 +721,8 @@
</ul>
</li>
</ul>
<li>m3 bits 6..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 : free</li>
<li>m5 : see m3 bit 7</li>

View File

@ -156,7 +156,7 @@ the array so you can quickly see what is used and what is not.
<td class="caption">finished house</td>
<td class="bits" rowspan=2><span class="used" title="House random bits">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="pool" title="Town index on pool">XXXX XXXX XXXX XXXX</span></td>
<td class="bits"><span class="used" title="House is complete/in construction (see m5)">1</span><span class="free">OO</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="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="used" title="Animated tile state">XX</span></td>
@ -165,7 +165,7 @@ the array so you can quickly see what is used and what is not.
</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)">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="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>

View File

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

View File

@ -8,10 +8,10 @@ This guide is for OpenTTD developers/maintainers, to release a new version of Op
* If this is an RC1 (first Release Candidate) build, create a new branch `release/nn` where `nn` is the major version number, then apply changes similar to [PR#9573](https://github.com/OpenTTD/OpenTTD/pull/9573). You also need to forwardport the changelog, as in [PR#10113](https://github.com/OpenTTD/OpenTTD/pull/10113).
* Update the version in `CMakeLists.txt` in the master branch, heading for the next major release, e.g. from 14.0 to 15.0.
* Add a new (empty) AI compatibility script in `bin/ai/`
* Add the new version to CheckAPIVersion in `src/ai/ai_info.cpp` and `src/game/game_info.cpp`
* 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 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

View File

@ -2,8 +2,8 @@
## Table of contents
- 1.0) About
- 2.0) Known bugs
- 1.0) [About](#10-about)
- 2.0) [Known bugs](#20-known-bugs)
## 1.0) About
@ -12,7 +12,7 @@ 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
bug tracking system at [https://github.com/OpenTTD/OpenTTD/issues](https://github.com/OpenTTD/OpenTTD/issues)
Also check the closed bugs when searching for your bug in this system as we
might have fixed the bug in the mean time.

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.6.
The currently included files correspond to release v0.7.

Binary file not shown.

View File

@ -1 +1 @@
8bc3926cb50e19747de498357417d973
a4a727b03a7cd07ee0499231f7f233f4

View File

@ -18,6 +18,7 @@ if(GRFCODEC_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/oneway.nfo
${CMAKE_CURRENT_SOURCE_DIR}/openttd.nfo
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui.nfo
${CMAKE_CURRENT_SOURCE_DIR}/overlay_rocks.nfo
${CMAKE_CURRENT_SOURCE_DIR}/palette.nfo
${CMAKE_CURRENT_SOURCE_DIR}/roadstops.nfo
${CMAKE_CURRENT_SOURCE_DIR}/road_waypoints.nfo
@ -42,6 +43,11 @@ if(GRFCODEC_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_road.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_tram.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_group_livery.png
${CMAKE_CURRENT_SOURCE_DIR}/overlay_rocks.png
${CMAKE_CURRENT_SOURCE_DIR}/overlay_snowy_rocks_1.png
${CMAKE_CURRENT_SOURCE_DIR}/overlay_snowy_rocks_2.png
${CMAKE_CURRENT_SOURCE_DIR}/overlay_snowy_rocks_3.png
${CMAKE_CURRENT_SOURCE_DIR}/overlay_snowy_rocks_4.png
${CMAKE_CURRENT_SOURCE_DIR}/roadstops.png
${CMAKE_CURRENT_SOURCE_DIR}/road_waypoints.png
${CMAKE_CURRENT_SOURCE_DIR}/signals.png

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -99,3 +99,4 @@
#include "tunnel_portals.nfo"
#include "palette.nfo"
#include "road_waypoints.nfo"
#include "overlay_rocks.nfo"

View File

@ -4,7 +4,7 @@
// See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
//
-1 * 0 0C "OpenTTD GUI graphics"
-1 * 3 05 15 \b 191 // OPENTTD_SPRITE_COUNT
-1 * 3 05 15 \b 192 // OPENTTD_SPRITE_COUNT
-1 sprites/openttdgui.png 8bpp 66 8 64 31 -31 7 normal
-1 sprites/openttdgui.png 8bpp 146 8 64 31 -31 7 normal
-1 sprites/openttdgui.png 8bpp 226 8 64 31 -31 7 normal
@ -196,3 +196,4 @@
-1 sprites/openttdgui.png 8bpp 567 440 12 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 581 440 10 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 593 440 10 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 605 440 8 10 0 0 normal

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,112 @@
// This file is part of OpenTTD.
// OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
// OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
//
-1 * 0 0C "Overlay rocks"
-1 * 3 05 1A 5F
// Plain overlay rocks (unused...)
-1 sprites/overlay_rocks.png 8bpp 1 1 64 31 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 81 1 64 31 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 161 1 64 23 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 241 1 64 23 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 321 1 64 31 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 401 1 64 31 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 481 1 64 23 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 561 1 64 23 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 641 1 64 39 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 721 1 64 39 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 801 1 64 31 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 881 1 64 31 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 961 1 64 39 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 1041 1 64 39 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 1121 1 64 31 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 1201 1 64 47 -31 -16 normal
-1 sprites/overlay_rocks.png 8bpp 1281 1 64 15 -31 0 normal
-1 sprites/overlay_rocks.png 8bpp 1361 1 64 31 -31 -8 normal
-1 sprites/overlay_rocks.png 8bpp 1441 1 64 31 -31 -8 normal
// Snowy rocks level 0
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 81 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 161 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 241 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 321 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 401 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 481 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 561 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 641 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 721 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 801 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 881 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 961 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1041 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1121 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1201 1 64 47 -31 -16 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1281 1 64 15 -31 0 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1361 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_1.png 8bpp 1441 1 64 31 -31 -8 normal
// Snowy rocks level 1
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 81 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 161 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 241 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 321 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 401 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 481 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 561 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 641 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 721 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 801 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 881 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 961 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1041 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1121 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1201 1 64 47 -31 -16 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1281 1 64 15 -31 0 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1361 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_2.png 8bpp 1441 1 64 31 -31 -8 normal
// Snowy rocks level 2
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 81 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 161 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 241 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 321 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 401 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 481 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 561 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 641 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 721 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 801 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 881 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 961 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1041 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1121 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1201 1 64 47 -31 -16 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1281 1 64 15 -31 0 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1361 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_3.png 8bpp 1441 1 64 31 -31 -8 normal
// Snowy rocks level 4
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 81 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 161 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 241 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 321 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 401 1 64 31 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 481 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 561 1 64 23 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 641 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 721 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 801 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 881 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 961 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1041 1 64 39 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1121 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1201 1 64 47 -31 -16 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1281 1 64 15 -31 0 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1361 1 64 31 -31 -8 normal
-1 sprites/overlay_snowy_rocks_4.png 8bpp 1441 1 64 31 -31 -8 normal

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -1,3 +1,12 @@
# If you change this version, change the numbers in .github/workflows/ci-emscripten.yml (2x)
# and .github/workflows/preview-build.yml (2x) too.
FROM emscripten/emsdk:3.1.57
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 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY ports/liblzma.py /emsdk/upstream/emscripten/tools/ports/contrib/liblzma.py

View File

@ -1,6 +1,7 @@
# LibLZMA is a custom addition to the emscripten SDK, so it is possible
# someone patched their SDK. Test out if the SDK supports LibLZMA.
include(CheckCXXSourceCompiles)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "--use-port=contrib.liblzma")
check_cxx_source_compiles("
@ -18,3 +19,5 @@ if (LIBLZMA_FOUND)
else()
message(WARNING "You are using an emscripten SDK without LibLZMA support. Many savegames won't be able to load in OpenTTD. Please copy liblzma.py to your ports/contrib folder in your local emsdk installation.")
endif()
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})

Binary file not shown.

View File

@ -24,7 +24,7 @@ if (!$Env:AZURE_CODESIGN_ENDPOINT -or !$Env:AZURE_CODESIGN_ACCOUNT_NAME -or !$En
exit
}
Install-Module -Name AzureCodeSigning -Scope CurrentUser -RequiredVersion 0.3.0 -Force -Repository PSGallery
Install-Module -Name TrustedSigning -Scope CurrentUser -RequiredVersion 0.5.3 -Force -Repository PSGallery
$params = @{}
@ -37,4 +37,4 @@ $params["FileDigest"] = "SHA256"
$params["TimestampRfc3161"] = "http://timestamp.acs.microsoft.com"
$params["TimestampDigest"] = "SHA256"
Invoke-AzureCodeSigning @params
Invoke-TrustedSigning @params

View File

@ -17,6 +17,10 @@ function Regression::TestInit()
print(" IsValid(vehicle.plane_speed): " + AIGameSettings.IsValid("vehicle.plane_speed"));
print(" vehicle.plane_speed: " + AIGameSettings.GetValue("vehicle.plane_speed"));
require("require.nut");
print(" TestEnum.value1: " + ::TestEnum.value1);
print(" test_constant: " + ::test_constant);
print(" TestEnum.value2: " + TestEnum.value2);
print(" test_constant: " + test_constant);
print(" min(6, 3): " + min(6, 3));
print(" min(3, 6): " + min(3, 6));
print(" max(6, 3): " + max(6, 3));
@ -265,15 +269,15 @@ function Regression::Bridge()
print(" Valid Bridges: " + j);
print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33160));
print(" GetBridgeID(): " + AIBridge.GetBridgeID(33160));
print(" GetBridgeType(): " + AIBridge.GetBridgeType(33160));
print(" RemoveBridge(): " + AIBridge.RemoveBridge(33155));
print(" GetLastErrorString(): " + AIError.GetLastErrorString());
print(" GetOtherBridgeEnd(): " + AIBridge.GetOtherBridgeEnd(33160));
print(" BuildBridge(): " + AIBridge.BuildBridge(AIVehicle.VT_ROAD, 5, 33160, 33155));
print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33160));
print(" GetBridgeID(): " + AIBridge.GetBridgeID(33160));
print(" GetBridgeType(): " + AIBridge.GetBridgeType(33160));
print(" IsBridgeTile(): " + AIBridge.IsBridgeTile(33155));
print(" GetBridgeID(): " + AIBridge.GetBridgeID(33155));
print(" GetBridgeType(): " + AIBridge.GetBridgeType(33155));
print(" GetOtherBridgeEnd(): " + AIBridge.GetOtherBridgeEnd(33160));
print(" BuildBridge(): " + AIBridge.BuildBridge(AIVehicle.VT_ROAD, 5, 33160, 33155));
print(" GetLastErrorString(): " + AIError.GetLastErrorString());
@ -824,6 +828,13 @@ function Regression::List()
print(" []:");
print(" 4000 => " + list[4000]);
print(" clone:");
local list3 = clone list;
print(" Clone ListDump:");
foreach (idx, val in list3) {
print(" " + idx + " => " + val);
}
list.Clear();
print(" IsEmpty(): " + list.IsEmpty());
@ -856,6 +867,12 @@ function Regression::List()
it = list.Next();
print(" " + it + " => " + list.GetValue(it));
}
print(" Clone ListDump:");
foreach (idx, val in list3) {
print(" " + idx + " => " + val);
}
}
function Regression::Map()
@ -1017,6 +1034,28 @@ function Regression::Order()
foreach (idx, val in list) {
print(" " + idx + " => " + val);
}
list = AIVehicleList_Station(3, AIVehicle.VT_ROAD);
print(" Count(): " + list.Count());
list.Valuate(AIVehicle.GetLocation);
print(" Location ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
print(" foreach():");
foreach (idx, val in list) {
print(" " + idx + " => " + val);
}
list = AIVehicleList_Station(3, AIVehicle.VT_RAIL);
print(" Count(): " + list.Count());
list.Valuate(AIVehicle.GetLocation);
print(" Location ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
print(" foreach():");
foreach (idx, val in list) {
print(" " + idx + " => " + val);
}
}
function Regression::RailTypeList()
@ -1675,13 +1714,22 @@ function Regression::TownList()
}
print(" HasStatue(): " + AITown.HasStatue(list.Begin()));
print(" GetRoadReworkDuration(): " + AITown.GetRoadReworkDuration(list.Begin()));
print(" GetExclusiveRightsCompany(): " + AITown.GetExclusiveRightsCompany(list.Begin()));
print(" GetExclusiveRightsDuration(): " + AITown.GetExclusiveRightsDuration(list.Begin()));
print(" IsActionAvailable(BUILD_STATUE): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE));
print(" PerformTownAction(BUILD_STATUE): " + AITown.PerformTownAction(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE));
print(" IsActionAvailable(BUILD_STATUE): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE));
print(" HasStatue(): " + AITown.HasStatue(list.Begin()));
print(" GetRoadReworkDuration(): " + AITown.GetRoadReworkDuration(list.Begin()));
print(" IsActionAvailable(ROAD_REBUILD): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_ROAD_REBUILD));
print(" PerformTownAction(ROAD_REBUILD): " + AITown.PerformTownAction(list.Begin(), AITown.TOWN_ACTION_ROAD_REBUILD));
print(" IsActionAvailable(ROAD_REBUILD): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_ROAD_REBUILD));
print(" GetRoadReworkDuration(): " + AITown.GetRoadReworkDuration(list.Begin()));
print(" GetExclusiveRightsCompany(): " + AITown.GetExclusiveRightsCompany(list.Begin()));
print(" GetExclusiveRightsDuration(): " + AITown.GetExclusiveRightsDuration(list.Begin()));
print(" IsActionAvailable(BUY_RIGHTS): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_BUY_RIGHTS));
print(" PerformTownAction(BUY_RIGHTS): " + AITown.PerformTownAction(list.Begin(), AITown.TOWN_ACTION_BUY_RIGHTS));
print(" IsActionAvailable(BUY_RIGHTS): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_BUY_RIGHTS));
print(" GetExclusiveRightsCompany(): " + AITown.GetExclusiveRightsCompany(list.Begin()));
print(" GetExclusiveRightsDuration(): " + AITown.GetExclusiveRightsDuration(list.Begin()));
}
function Regression::Tunnel()
@ -1975,6 +2023,33 @@ function Regression::Math()
print(" 13725 > -2147483648: " + ( 13725 > -2147483648));
}
function Regression::PriorityQueue()
{
print("");
print("--PriorityQueue--");
local queue = AIPriorityQueue();
print(" IsEmpty(): " + queue.IsEmpty());
print(" Count(): " + queue.Count());
print(" --Insert--")
for (local i = 0; i < 10; i++) {
print(" Insert(" + i + ", " + i + "): " + queue.Insert(i, i));
}
print(" Exists(5): " + queue.Exists(5));
print(" Insert(5, 5): "+ queue.Insert(5, 5));
print(" IsEmpty(): " + queue.IsEmpty());
print(" Count(): " + queue.Count());
local item = queue.Peek();
print(" Peek(): " + item);
print(" Count(): " + queue.Count());
local item2 = queue.Pop();
print(" Pop(): " + item2);
print(" Count(): " + queue.Count());
print(" " + item + " == " + item2 + " : " + (item == item2));
print(" Clear(): " + queue.Clear());
print(" IsEmpty(): " + queue.IsEmpty());
print(" Count(): " + queue.Count());
}
function Regression::Start()
{
this.TestInit();
@ -2035,6 +2110,34 @@ function Regression::Start()
print(" VehicleID: " + c.GetVehicleID());
} break;
case AIEvent.ET_COMPANY_RENAMED: {
local c = AIEventCompanyRenamed.Convert(e);
print(" EventName: CompanyRenamed");
print(" CompanyID: " + c.GetCompanyID());
print(" CompanyName: " + c.GetNewName());
} break;
case AIEvent.ET_PRESIDENT_RENAMED: {
local c = AIEventPresidentRenamed.Convert(e);
print(" EventName: PresidentRenamed");
print(" CompanyID: " + c.GetCompanyID());
print(" PresidentName: " + c.GetNewName());
} break;
case AIEvent.ET_EXCLUSIVE_TRANSPORT_RIGHTS: {
local c = AIEventExclusiveTransportRights.Convert(e);
print(" EventName: ExclusiveTransportRights");
print(" CompanyID: " + c.GetCompanyID());
print(" TownID: " + c.GetTownID());
} break;
case AIEvent.ET_ROAD_RECONSTRUCTION: {
local c = AIEventRoadReconstruction.Convert(e);
print(" EventName: RoadReconstruction");
print(" CompanyID: " + c.GetCompanyID());
print(" TownID: " + c.GetTownID());
} break;
default:
print(" Unknown Event");
break;
@ -2043,12 +2146,18 @@ function Regression::Start()
print(" IsEventWaiting: false");
this.Math();
this.PriorityQueue();
/* Check Valuate() is actually limited, MUST BE THE LAST TEST. */
print("--Valuate() with excessive CPU usage--")
local list = AIList();
list.AddItem(0, 0);
local Infinite = function(id) { while(true); }
try {
list = AIIndustryList(Infinite);
} catch (e) {
print("constructor failed with: " + e);
}
list.Valuate(Infinite);
}

View File

@ -1,2 +1,9 @@
print(" Required this file");
const test_constant = 1;
enum TestEnum {
value0,
value1,
value2
};

View File

@ -8,6 +8,10 @@
IsValid(vehicle.plane_speed): true
vehicle.plane_speed: 2
Required this file
TestEnum.value1: 1
test_constant: 1
TestEnum.value2: 2
test_constant: 1
min(6, 3): 3
min(3, 6): 3
max(6, 3): 6
@ -81,7 +85,7 @@
20
30
40
Ops: 8673
Ops: 8649
--Std--
abs(-21): 21
@ -571,6 +575,13 @@
4006 => 12
[]:
4000 => 50
clone:
Clone ListDump:
1005 => 1005
4000 => 50
4001 => 8002
4002 => 8004
4006 => 12
IsEmpty(): true
0 => 5 (true)
ERROR: Next() is invalid as Begin() is never called
@ -580,6 +591,12 @@ ERROR: IsEnd() is invalid as Begin() is never called
2 => 6 (true)
3 => 6 (true)
9 => 0 (false)
Clone ListDump:
1005 => 1005
4000 => 50
4001 => 8002
4002 => 8004
4006 => 12
--Company--
SetName(): true
@ -1051,15 +1068,15 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetMinLength(): -1
Valid Bridges: 10
IsBridgeTile(): false
GetBridgeID(): -1
GetBridgeType(): -1
RemoveBridge(): false
GetLastErrorString(): ERR_PRECONDITION_FAILED
GetOtherBridgeEnd(): -1
BuildBridge(): true
IsBridgeTile(): true
GetBridgeID(): 5
GetBridgeType(): 5
IsBridgeTile(): true
GetBridgeID(): 5
GetBridgeType(): 5
GetOtherBridgeEnd(): 33155
BuildBridge(): false
GetLastErrorString(): ERR_ALREADY_BUILT
@ -9423,13 +9440,22 @@ ERROR: IsEnd() is invalid as Begin() is never called
23 => 652
25 => 563
HasStatue(): false
GetRoadReworkDuration(): 0
GetExclusiveRightsCompany(): -1
GetExclusiveRightsDuration(): 0
IsActionAvailable(BUILD_STATUE): true
PerformTownAction(BUILD_STATUE): true
IsActionAvailable(BUILD_STATUE): false
HasStatue(): true
GetRoadReworkDuration(): 0
IsActionAvailable(ROAD_REBUILD): true
PerformTownAction(ROAD_REBUILD): true
IsActionAvailable(ROAD_REBUILD): true
GetRoadReworkDuration(): 6
GetExclusiveRightsCompany(): -1
GetExclusiveRightsDuration(): 0
IsActionAvailable(BUY_RIGHTS): true
PerformTownAction(BUY_RIGHTS): true
IsActionAvailable(BUY_RIGHTS): false
GetExclusiveRightsCompany(): 1
GetExclusiveRightsDuration(): 12
--Tunnel--
IsTunnelTile(): false
@ -9694,6 +9720,14 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetStopLocation(): 1
--VehicleList_Station--
Count(): 1
Location ListDump:
20 => 23596
foreach():
20 => 23596
Count(): 0
Location ListDump:
foreach():
Count(): 1
Location ListDump:
20 => 23596
@ -9711,6 +9745,31 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetDestinationType(): 1
GetDestinationIndex(): 7
GetCargoType(): 0
GetNextEvent: instance
GetEventType: 33
EventName: CompanyRenamed
CompanyID: 1
CompanyName: Regression
GetNextEvent: instance
GetEventType: 34
EventName: PresidentRenamed
CompanyID: 1
PresidentName: Regression AI
GetNextEvent: instance
GetEventType: 33
EventName: CompanyRenamed
CompanyID: 1
CompanyName: Little Frutford Transport
GetNextEvent: instance
GetEventType: 28
EventName: RoadReconstruction
CompanyID: 1
TownID: 12
GetNextEvent: instance
GetEventType: 27
EventName: ExclusiveTransportRights
CompanyID: 1
TownID: 12
IsEventWaiting: false
--Math--
@ -9745,21 +9804,38 @@ ERROR: IsEnd() is invalid as Begin() is never called
-1 > 2147483647: false
-2147483648 > 2147483647: false
13725 > -2147483648: true
--PriorityQueue--
IsEmpty(): true
Count(): 0
--Insert--
Insert(0, 0): true
Insert(1, 1): true
Insert(2, 2): true
Insert(3, 3): true
Insert(4, 4): true
Insert(5, 5): true
Insert(6, 6): true
Insert(7, 7): true
Insert(8, 8): true
Insert(9, 9): true
Exists(5): true
Insert(5, 5): true
IsEmpty(): false
Count(): 11
Peek(): 0
Count(): 11
Pop(): 0
Count(): 10
0 == 0 : true
Clear(): (null : 0x00000000)
IsEmpty(): true
Count(): 0
--Valuate() with excessive CPU usage--
constructor failed with: excessive CPU usage in list filter function
Your script made an error: excessive CPU usage in valuator function
*FUNCTION [unknown()] regression/main.nut line [2051]
*FUNCTION [Valuate()] NATIVE line [-1]
*FUNCTION [Start()] regression/main.nut line [2052]
[id] 0
[this] TABLE
[Infinite] CLOSURE
[list] INSTANCE
[this] INSTANCE
Your script made an error: excessive CPU usage in valuator function
*FUNCTION [Start()] regression/main.nut line [2052]
*FUNCTION [Start()] regression/main.nut line [2161]
[Infinite] CLOSURE
[list] INSTANCE

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