1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-21 05:29:11 +00:00

Compare commits

..

2217 Commits

Author SHA1 Message Date
translators
b3beff9781 Update: Translations from eints
swedish: 2 changes by joeax910
chinese (traditional): 2 changes by KogentaSan
english (us): 4 changes by 2TallTyler
chinese (simplified): 2 changes by WenSimEHRP
finnish: 2 changes by hpiirai
2025-08-21 04:40:46 +00:00
7a47f7b834 Change: Tweak tubular bridges to remove baked-in pillars. 2025-08-20 21:40:41 +01:00
9a294ab2ed Feature: Allow stations and roadstops under bridges.
Bridges above stations will have pillars excluded if they conflict with the station layout.

Partly based on the system implemented in JGRPP.

Co-authored-by: <su@angel-island.zone>
2025-08-20 21:40:41 +01:00
6d6e64b1f0 Add: [NewGRF] Bridge pillar exclusion information for stations and roadstops.
NewGRF stations and roadstops can now specify bridge pillar and minimum height information for their tiles.
2025-08-20 21:40:41 +01:00
f30f808b50 Codechange: Implement tile proc handler to test for building bridge over tile. 2025-08-20 21:40:41 +01:00
translators
77503776b6 Update: Translations from eints
english (au): 2 changes by krysclarke
norwegian (bokmal): 7 changes by eriksorngard
chinese (traditional): 2 changes by KogentaSan
korean: 7 changes by telk5093
russian: 2 changes by Ln-Wolf
catalan: 24 changes by J0anJosep
portuguese (brazilian): 2 changes by pasantoro
polish: 2 changes by pAter-exe
2025-08-20 04:40:05 +00:00
1cb0cbcb6c Codechange: Standardise how AllocateSpecToStation/RoadStop are called. (#14525)
Replace use of negative value with std::optional and update doxygen.
2025-08-19 18:52:36 +01:00
translators
5eeede82c5 Update: Translations from eints
swedish: 4 changes by robert-i
english (us): 2 changes by 2TallTyler
greek: 2 changes by gh658804
2025-08-19 04:39:40 +00:00
3a5eaf367a Feature: Option to disable activate-on-release behaviour of toolbar dropdown buttons. 2025-08-18 19:48:22 +01:00
ea9bee2a3e Fix: Close dropdown menu when user clicks on a differenet window.
This did not happen if the clicked window is flagged as unfocusable (i.e. the main toolbar.)
2025-08-18 19:48:22 +01:00
translators
1850ad1aa2 Update: Translations from eints
chinese (traditional): 2 changes by KogentaSan
russian: 2 changes by Ln-Wolf
2025-08-18 04:46:26 +00:00
Jonathan G Rennison
add40a2de2 Fix #10222: Off by one drawing even-width horizontal/vertical lines 2025-08-17 20:41:49 +01:00
Jonathan G Rennison
80f72d3722 Fix: Off-by-one in Blitter::DrawLineGeneric 2025-08-17 20:41:22 +01:00
Loïc Guilloux
2d60b9d7b9 Codefix: [macos] variable length array warnings with clang-17 (#14521) 2025-08-17 19:47:31 +02:00
translators
88923a3f18 Update: Translations from eints
english (au): 2 changes by krysclarke
chinese (simplified): 4 changes by WenSimEHRP
finnish: 2 changes by hpiirai
french: 52 changes by glx22
portuguese: 2 changes by jcteotonio
portuguese (brazilian): 2 changes by pasantoro
polish: 2 changes by pAter-exe
2025-08-17 04:45:07 +00:00
translators
94ba9b1454 Update: Translations from eints
hungarian: 2 changes by vargaviktor
finnish: 2 changes by hpiirai
dutch: 3 changes by Afoklala
2025-08-16 04:41:07 +00:00
dP
628a23a990 Fix: [Script] Invalid title on GSGoal.Question windows (#14519) 2025-08-16 00:55:09 +02:00
0a1c0b8b48 Change: Hide bridge pillars if obstructed by tile below.
Tiles can now control if pillars are drawn on a bridge above it. There is no visible change with default bridges.
2025-08-15 23:20:18 +01:00
48b42492bc Add: [NewGRF] Add extra information to bridges about pillars.
Bridges can now include information about pillars and blocked edges for each bridge piece.

This data is set for default bridges, and NewGRFs can provide their own pillar information.
2025-08-15 23:20:18 +01:00
Su
85af200788 Add: Identify cities on the main viewport by appending an icon to their names (#14504)
Co-authored-by: Peter Nelson <peter1138@openttd.org>
2025-08-15 16:49:25 -04:00
Tyler Trahan
3d806d6a65 Fix: 'Map edges' GUI buttons shouldn't initialize with water on northeast edge (#14514) 2025-08-14 08:25:16 -04:00
980121cdf5 Codefix: Don't store palette for track detail in temporary global variable. (#14516)
Pass palette via parameters instead.
2025-08-14 12:28:36 +01:00
translators
1399efd72a Update: Translations from eints
portuguese: 2 changes by jcteotonio
2025-08-14 04:44:10 +00:00
376b2f42c9 Fix 0878f71051: Incorrect station layout for even platform counts. (#14515) 2025-08-13 23:18:26 +01:00
0878f71051 Codechange: Add RailStationTileLayout iterator. (#14510)
This allows iterating a predefined or calculated rail station layout without allocating extra memory and copying.
2025-08-13 17:23:19 +01:00
translators
5b5bdd346d Update: Translations from eints
english (au): 2 changes by krysclarke
chinese (traditional): 2 changes by KogentaSan
english (us): 4 changes by 2TallTyler
chinese (simplified): 2 changes by WenSimEHRP
greek: 2 changes by gh658804
portuguese (brazilian): 2 changes by pasantoro
polish: 2 changes by pAter-exe
2025-08-13 04:43:07 +00:00
f898acae3e Codechange: Remove line break before opening brace of Yapf classes. (#14513) 2025-08-12 21:08:41 +01:00
translators
f1a33d50a7 Update: Translations from eints
english (au): 1 change by krysclarke
chinese (simplified): 1 change by WenSimEHRP
2025-08-12 04:42:13 +00:00
b4ebb26c55 Codechange: Remove SpriteGroupType from SpriteGroup. (#14511) 2025-08-11 23:14:44 +01:00
Tyler Trahan
f596498a28 Fix #14486: Make cargo graph All/None tooltips less specific (#14509) 2025-08-11 16:08:05 -04:00
1af721a6f0 Add: [Badges] Vehicle variable to query badges of current rail or road types. (#14312) 2025-08-11 19:08:48 +01:00
cd61682ebf Codefix: Don't unnecessarily extract string from bridge CommandCost result. (#14507) 2025-08-10 22:01:03 +01:00
Tyler Trahan
78f7060994 Fix: Standardize "rail waypoint" strings (#14505) 2025-08-10 10:56:33 -04:00
translators
3587db6a23 Update: Translations from eints
swedish: 1 change by robert-i
english (us): 1 change by 2TallTyler
portuguese: 1 change by jcteotonio
2025-08-10 04:46:46 +00:00
translators
850bf1c715 Update: Translations from eints
dutch: 6 changes by Afoklala
2025-08-09 04:42:25 +00:00
4a4613e630 Change: Reduce visual height of default rail waypoints. (#14503)
Added 20 years ago, these were perhaps out of proportion with default rail stations.
2025-08-08 17:53:46 +01:00
frosch
66b775016a Fix: Original graphics' tycoon-of-the-century sprite assumes a black background. 2025-08-08 18:15:24 +02:00
Kuhnovic
40457fc0dd Change: Separate ships travelling in opposite direction (#14493) 2025-08-08 09:52:01 +02:00
translators
c8a07fe90b Update: Translations from eints
chinese (traditional): 36 changes by KogentaSan
2025-08-08 04:47:48 +00:00
merni-ns
e1b404089c Fix #13307: Return non-zero value when there is a mistake in command-line arguments
Specifically, when the savegame passed to -q cannot be read or when non-existent/invalid options are passed
2025-08-07 23:28:57 +02:00
e1a50abcbb Codechange: Move fallback font detection to FontCacheFactory.
Provides a standard interface instead of relying on defines.
2025-08-07 19:38:00 +01:00
140f2b291a Codechange: Use ProviderManager interface to register FontCache factories.
This removes use of #ifdefs to select the appropriate loader, and also replaces FontCache self-registration.
2025-08-07 19:38:00 +01:00
ed1262cab9 Codefix: Move provider instances to static members. (#14501)
Avoids misnaming in global scope.
2025-08-07 09:21:44 +01:00
translators
2b6cb8a2d2 Update: Translations from eints
english (au): 1 change by krysclarke
norwegian (bokmal): 1 change by eriksorngard
chinese (traditional): 2 changes by KogentaSan
greek: 1 change by gh658804
hungarian: 1 change by vargaviktor
german: 190 changes by Wuzzy2
russian: 1 change by Ln-Wolf
finnish: 1 change by hpiirai
portuguese (brazilian): 1 change by pasantoro
polish: 3 changes by pAter-exe
2025-08-07 04:48:50 +00:00
1ccbd735d8 Codechange: Extract function to draw custom rail station foundations. (#14492) 2025-08-06 23:46:53 +01:00
translators
73a69fd171 Update: Translations from eints
swedish: 55 changes by robert-i
norwegian (bokmal): 8 changes by eriksorngard
spanish (mexican): 1 change by absay
chinese (simplified): 1 change by WenSimEHRP
2025-08-06 04:47:48 +00:00
Mizuki Nguyen
45929c1672 Add: Currency: Vietnamese Dong (#14474) 2025-08-05 20:16:12 +01:00
cb12a59eed Fix #14495: Dangling references in Industry Production graph window. (#14496) 2025-08-05 20:14:55 +01:00
439723b718 Codechange: Use handler structs for NewGRF action map sprite groups. (#14489)
Reduces code duplication for mapping sprite groups across GRF features.
2025-08-05 20:14:30 +01:00
b0f247df23 Fix #14498: Crash when cloning aircraft with no orders. (#14499) 2025-08-05 20:08:23 +01:00
Tyler Trahan
8c58fb1efd Fix: Missing button beeps (#14470) 2025-08-05 13:57:45 -04:00
translators
dea40880a4 Update: Translations from eints
english (us): 5 changes by 2TallTyler
portuguese: 2 changes by jcteotonio
polish: 1 change by pAter-exe
2025-08-05 04:48:13 +00:00
translators
d545cec9a2 Update: Translations from eints
english (au): 5 changes by krysclarke
chinese (traditional): 7 changes by KogentaSan
chinese (simplified): 11 changes by WenSimEHRP
korean: 5 changes by telk5093
greek: 7 changes by gh658804
hungarian: 5 changes by vargaviktor
russian: 7 changes by Ln-Wolf
finnish: 5 changes by hpiirai
portuguese: 5 changes by jcteotonio
portuguese (brazilian): 5 changes by pasantoro
polish: 6 changes by pAter-exe
2025-08-04 04:50:00 +00:00
5b1c6772da Fix 557fb0bd78, bd57aee3a9: Remove separate x-axis label for industry/town production graph. (#14497)
This is no longer necessary (and is wrong) as it's now part of the horizontal scale selector.
2025-08-03 20:04:17 +01:00
5ee186e850 Codefix: Possible use of uninitialised variable. (#14494)
Realistically this can't happen but gcc 12.2 warns.
2025-08-03 10:48:26 +00:00
translators
61c1f2a35b Update: Translations from eints
polish: 6 changes by pAter-exe
2025-08-03 04:48:21 +00:00
bd57aee3a9 Add: Town cargo history graphs. (#14461) 2025-08-02 23:19:43 +01:00
kojonek2
aac3a5b683 Fix #12900: Join station window will be shown for stations with existing stations in tile gaps 2025-08-02 20:37:02 +02:00
translators
8f9d4150bc Update: Translations from eints
norwegian (bokmal): 11 changes by eriksorngard
english (us): 6 changes by 2TallTyler
korean: 6 changes by telk5093
dutch: 6 changes by Afoklala
2025-08-02 04:46:00 +00:00
translators
4d03b4b618 Update: Translations from eints
portuguese: 1 change by jcteotonio
2025-08-01 04:49:17 +00:00
Loïc Guilloux
2a0e0b4b68 Fix #14490, 0455627d: Incorrect detection of final order when drawing timetable (#14491) 2025-08-01 03:39:02 +02:00
Ian Earle
ec7c8dd095 Codefix: Updating doxygen file documentation string for group_sl.cpp (#14488) 2025-07-31 12:39:22 -04:00
Tyler Trahan
48e3aa1027 Fix #14415: Update survey option text when changing setting (#14487) 2025-07-31 06:03:51 -04:00
translators
22bcb8bd46 Update: Translations from eints
english (au): 6 changes by krysclarke
chinese (traditional): 8 changes by KogentaSan
spanish (mexican): 6 changes by absay
greek: 6 changes by gh658804
hungarian: 6 changes by vargaviktor
russian: 6 changes by Ln-Wolf
finnish: 6 changes by hpiirai
portuguese: 6 changes by jcteotonio
portuguese (brazilian): 6 changes by pasantoro
2025-07-31 04:47:22 +00:00
translators
fe95782047 Update: Translations from eints 2025-07-30 04:47:35 +00:00
557fb0bd78 Change: Add support for different horizontal graph scales. 2025-07-30 01:13:05 +01:00
d09dfd843c Codechange: Extend industry cargo history to 24 years.
Monthly data is stored for the current 24 months.
Quarterly data is stored for a further 2-6 years.
Yearly data is stored for a further 6-24 years.
2025-07-30 01:13:05 +01:00
translators
8675d7b498 Update: Translations from eints
chinese (simplified): 5 changes by WenSimEHRP
2025-07-29 04:48:22 +00:00
translators
7c8759552a Update: Translations from eints
japanese: 40 changes by akaregi
hungarian: 6 changes by nemesbala
2025-07-28 04:48:20 +00:00
614a01907a Codechange: Make functions for click and confirm beeps. (#14484)
Avoids repetition.
2025-07-27 21:54:32 +01:00
f51067f9f5 Codechange: Give all bridge sprite tables descriptive names. (#14483)
Finish off the work started 17 years ago...
2025-07-27 20:14:37 +01:00
009b7cbc57 Fix #14480: Music player playlist buttons are clickable but non-operational in intro menu. (#14482)
In the intro menu the music is hardcoded to be the introduction track. Therefore, prevent these buttons being clickable.
2025-07-27 16:03:47 +01:00
translators
79524af5fc Update: Translations from eints
spanish (mexican): 6 changes by absay
galician: 6 changes by pvillaverde
dutch: 6 changes by Afoklala
polish: 3 changes by pAter-exe
2025-07-27 04:48:17 +00:00
translators
d764d59f5a Update: Translations from eints
chinese (traditional): 7 changes by KogentaSan
welsh: 62 changes by Ansbaradigeidfran
2025-07-26 04:46:16 +00:00
13759e9f23 Fix: Display GRFID in correct hex format. (#14478) 2025-07-25 08:41:48 +01:00
translators
3e06c69e26 Update: Translations from eints
portuguese: 1 change by jcteotonio
polish: 6 changes by pAter-exe
2025-07-25 04:47:26 +00:00
translators
7eb042feac Update: Translations from eints
english (us): 5 changes by 2TallTyler
2025-07-24 04:46:38 +00:00
10eeba86a6 Codechange: Simplify/breakout logic for selecting bridge table sprites.
Move various base offsets to separate functions where they can be reused and documented.

No longer rely on coincidences to select the correct data between bridges and aqueducts.
2025-07-23 20:31:15 +01:00
d99dad9e9e Codechange: Pass bridge pillar palette/sprite by reference. 2025-07-23 20:31:15 +01:00
translators
ae917cb8c6 Update: Translations from eints
vietnamese: 134 changes by MagicalDrizzle
2025-07-23 04:48:20 +00:00
translators
6d95cea73a Update: Translations from eints
english (au): 5 changes by krysclarke
korean: 6 changes by telk5093
greek: 5 changes by gh658804
russian: 5 changes by Ln-Wolf
finnish: 5 changes by hpiirai
portuguese: 5 changes by jcteotonio
portuguese (brazilian): 5 changes by pasantoro
2025-07-22 04:46:31 +00:00
921d83c324 Codechange: Unify structures with sprite sub-tile bounds and simplify bounding boxes. (#14424)
Lots of different structs contain variations on sub-tile bounds with different naming. Unify into a single struct that can be inherited and passed directly to AddSortableSpriteToDraw.

At the same time, offsets now work more logically: sub-tile bounds now specify the bounding box, and an offset can be applied to the sprite.
2025-07-22 00:02:00 +01:00
c69fc76395 Codefix: Rail type bridge offset is not a SpriteID. (#14471) 2025-07-21 20:00:04 +00:00
translators
1d21edde8d Update: Translations from eints
english (us): 1 change by 2TallTyler
2025-07-21 04:47:54 +00:00
b82ffa3542 Codechange: Decouple glyph map from SpriteFontCache instances. (#14449)
This makes the map independent from the SpriteFontCache instances.
2025-07-20 22:58:43 +01:00
8e2df7809b Codechange: Add distinct type to hold pixel drawing colour. (#14457)
This is used for individual pixels as well as line drawing.
2025-07-20 22:57:55 +01:00
Jonathan G Rennison
821784004d Fix: [Linkgraph] Incorrect NodeID to StationID conversion for EraseFlows 2025-07-20 16:07:11 +02:00
Jonathan G Rennison
f0447d59d4 Codechange: Use StationID as StationIDStack Titem type 2025-07-20 16:06:03 +02:00
Jonathan G Rennison
cbdd358ae8 Codechange: Allow SmallStack Titem type to be non-structural 2025-07-20 16:06:03 +02:00
2cdd50f40e Fix 03f5f7145f: Wrong colour used when string POP_COLOURs back to initial colour. (#14468)
Fixing ellipsis colour broke the PUSH_COLOUR/POP_COLOUR system, reverting to the last used colour instead of the initial colour.
2025-07-20 14:30:18 +01:00
56942a15c7 Add: Industry accepted and waiting history graphs.
Records amount of cargo accepted, and a rolling average of the waiting amount.

Average waiting samples the waiting amount once per day for each industry, spread out over an economy day.
2025-07-20 14:03:54 +01:00
5eeda026a4 Codechange: Allow unused graph ranges to be masked. 2025-07-20 14:03:54 +01:00
edc5b8ea1f Fix #14464: Invalid string parameter in scenario editor when unable to build industry. (#14465)
Resolved by removing the Build Industry command callback. This was used to display an error message in the scenario editor, however an error is already automatically displayed.
2025-07-20 14:03:29 +01:00
a8650c6b06 Codechange: Make SpriteCacheCtrlFlags an enum bit set. (#14462)
Due to header dependencies, this requires types to split from the spritecache header.
2025-07-19 23:49:15 +01:00
7bb4940ebd Codechange: Use unique_ptr for all pointers in script instance. (#14339)
Removes manual memory management with new/delete.
2025-07-19 09:29:30 +01:00
translators
b8e56cd05d Update: Translations from eints
chinese (traditional): 3 changes by KogentaSan
chinese (simplified): 1 change by ahyangyi
2025-07-19 04:43:14 +00:00
df5237e721 Fix: Vehicle liveries did not update when switching company. (#14456)
Vehicle liveries must be refreshed if "Show vehicle-type specific liveries" is set to "Own company".
2025-07-18 23:43:07 +00:00
03f5f7145f Fix f6e78a480d: Truncation ellipsis always drawn in initial colour. (#14451)
Truncation ellipsis is now a layouted line, so we can no longer rely on implicitly using the last set colour.
2025-07-18 18:24:19 +01:00
0dc40877fd Codechange: Initialise/reset font cache with FontSizes bitset. (#14448)
Instead of choosing either "Normal/Small/Large" or "Monospace", use an EnumBitSet to allow any combination.
2025-07-18 18:23:28 +01:00
Jonathan G Rennison
03672ed8eb Fix: EngineImageType mismatch between sizing and drawing in preview window (#14455) 2025-07-18 07:02:46 -04:00
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
67e56391c7 Fix #8167: No error sub-message when trying to clear protected buildings. (#14444) 2025-07-14 23:23:15 +01:00
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
9ce2aca949 Codechange: Get/pass ScriptStorage by reference instead of pointer. 2025-07-14 19:19:29 +01:00
55098a2f2e Codechange: Get/pass engine by reference instead of pointer. 2025-07-14 19:19:29 +01:00
7ff0c67f77 Codechange: Get/pass script controller by reference instead of pointer. 2025-07-14 19:19:29 +01:00
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
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
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
a6143eea21 Codechange: Include more relevant headers for script_storage. (#14437) 2025-07-14 07:49:50 +01:00
1d38cbafcb Codechange: Use unique_ptr for ScriptInfo instances.
Replaces raw pointers, slightly.
2025-07-14 00:10:14 +01:00
992d58d799 Codechange: Pass ScriptInfo by reference to IsSameScript. 2025-07-14 00:10:14 +01:00
8f34b7a821 Codechange: Keep Squirrel engine in unique_ptr. 2025-07-14 00:10:14 +01:00
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
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
9b55ad5b8d Codechange: Generic type and container for history statistics. 2025-07-09 23:02:58 +01:00
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
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
77b572619a Codechange: Make use of ZoomLevels range iteration. (#14422) 2025-07-08 14:00:12 +01:00
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
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
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
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
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
36d7e09369 Fix: Include sort button width in content list header minimal size. (#14402) 2025-06-30 20:40:26 +01:00
42a9d27fd9 Fix: Don't draw truncation ellipsis if it's too wide. (#14401) 2025-06-30 20:40:04 +01:00
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
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
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
bd2430dc94 Codechange: Use FlatSet to avoid trying to add variant parents multiple times. 2025-06-26 08:33:34 +01:00
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
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
8f01ae675e Revert 0853c1979b: Button to toggle showing advanced signal types (#9617) (#14219) 2025-06-24 20:18:08 +02:00
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
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
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
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
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
c882ad5142 Fix: Allow object picker to resize if there are no classes. (#14372) 2025-06-17 19:04:34 +01:00
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
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
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
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
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
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
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
28cc0079f2 Codechange: Create ScriptAllocator with make_unique instead of new. (#14340) 2025-06-11 23:28:08 +01:00
b2d69ae606 Codechange: Use AutoRelease to simplify cleanup after FontConfig calls. (#14354) 2025-06-11 21:24:31 +01:00
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
f2318c35db Fix 0455627d16: Order backups were no longer created when selling vehicles. (#14352) 2025-06-10 18:03:05 +01:00
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
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
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
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
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
2f725d1e85 Add: Hover on graph legend to highlight line. 2025-06-07 15:50:25 +01:00
10841ea3fd Codechange: Add constant for common blink interval. 2025-06-07 15:50:25 +01:00
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
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
48764b0fed Add: Badge dropdown filters to picker window. 2025-06-05 17:55:24 +01:00
7b60e5ccad Add: Badge dropdown filters to build vehicle window. 2025-06-05 17:55:24 +01:00
25f1c97bea Change: Add badge dropdown filters and configuration. 2025-06-05 17:55:24 +01:00
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
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
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
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
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
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
b7b2b57805 Fix bd1a3fe0b7: Crash if loading compatibility scripts fails. (#14318) 2025-05-31 19:59:23 +01:00
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
c233e5ee2c Codechange: Tweak layouts of graph windows to reduce spacers. 2025-05-28 18:40:33 +01:00
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
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
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
b042e7a439 Codefix: Prefer static inline const keyword order. (#14301) 2025-05-25 20:32:56 +01:00
948ceb3b17 Add: Button to configure badges in build picker window. 2025-05-25 09:13:05 +01:00
f28dc3cca4 Add: Button to configure badges in build vehicle window. 2025-05-25 09:13:05 +01:00
c2d4098afa Add: Configuration of NewGRF badges. 2025-05-25 09:13:05 +01:00
daef052329 Add: Generic "configure list/view" vertical ellipsis icon. 2025-05-25 09:13:05 +01:00
29970fb496 Codechange: Add DropDownToggle component. 2025-05-25 09:13:05 +01:00
6e90b828c6 Codechange: Add CentreTo Rect method. 2025-05-25 09:13:05 +01:00
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
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
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
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
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
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
46b745a06a Codechange: Use a helper method to test if text file window is wrapped. 2025-05-23 07:42:10 +01:00
940071a5f2 Codechange: Add alternating iterator to take elements from middle of range. 2025-05-23 07:42:10 +01:00
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
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
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
9f190aa534 Codechange: Use group's children list to improve performance of group UI. 2025-05-21 19:50:07 +01:00
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
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
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
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
ce83f583bc Codechange: Use EnumBitSet for VehicleRailFlags. (#14280) 2025-05-19 18:56:45 +01:00
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
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
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
c50ee282f9 Codechange: EnumBitSet bits can be iterated directly. 2025-05-14 07:22:12 +01:00
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
87fa1e41d5 Codechange: Use std::byte for sound buffers. 2025-05-13 14:51:17 +01:00
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
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
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
431e57d087 Fix 0ce30d05c8: Replacing a dropdown list could reposition it partially off-screen. (#14261) 2025-05-13 01:22:45 +01:00
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
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
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
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
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
2feba80fd7 Codechange: Codestyle fixes for elrail code. 2025-05-07 20:34:33 +01:00
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
a7019b859c Codechange: Use DiagDirections when checking for flat buildable tiles. 2025-05-07 17:31:29 +01:00
aa9e5b38cd Codechange: Use DiagDirections when drawing level crossings. 2025-05-07 17:31:29 +01:00
1ac9f24f38 Codechange: Use (Diag)Directions when drawing catenary. 2025-05-07 17:31:29 +01:00
87544eff0c Codechange: Use DiagDirections to collect rail fence data. 2025-05-07 17:31:29 +01:00
1cbc4da054 Codechange: Use Directions for water flooding data. 2025-05-07 17:31:29 +01:00
968bb8961e Codechange: Add Directions and DiagDirections EnumBitSets. 2025-05-07 17:31:29 +01:00
e0dbbbb032 Codechange: Add Reset() and missing &=/|= operators for BaseBitSet. 2025-05-07 17:31:29 +01:00
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
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
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
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
e23de03a99 Codechange: Use FlatSet for sprite picker list. 2025-05-05 14:00:38 +01:00
b06273f716 Codechange: Use FlatSet when searching tiles around stations. 2025-05-05 14:00:38 +01:00
7679b0bc46 Codechange: Use FlatSet when filtering and drawing badge names. 2025-05-05 14:00:38 +01:00
5fd7344a6d Codechange: Use FlatSet when creating rivers. 2025-05-05 14:00:38 +01:00
7c834921b2 Codechange: Use FlatSet for per-industry type industry lists. 2025-05-05 14:00:38 +01:00
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
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
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
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
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
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
31754a0afd Fix: Changing monospace font didn't refresh the monospace width cache. (#14185) 2025-05-03 18:34:45 +01:00
7596f98e2d Codechange: Cache layouted text for the last used width. (#14177) 2025-05-03 18:33:47 +01:00
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
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
3eba97f67c Codechange: Scrollbar Count no longer needs to be clamped to uint16_t. (#14184) 2025-05-02 22:21:05 +01:00
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
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
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
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
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
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
0abebfce1c Codechange: Use result of .find() instead of looking up multiple times. (#14154) 2025-04-29 23:52:46 +01:00
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
a5578166bb Codechange: Pass Script Info by reference. 2025-04-28 23:08:20 +01:00
341cdbc16b Codechange: Pass Script engine by reference. 2025-04-28 23:08:20 +01:00
72ca962b84 Codechange: Pass ScriptInstance by reference. 2025-04-28 23:08:20 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
78d3eaf3e2 Change: Slider widget can now be colourful. 2025-04-23 19:07:52 +01:00
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
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
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
77da79a052 Codechange: Remove unnecessary SetMinimalSize from Game Options window. 2025-04-23 19:07:52 +01:00
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
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
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
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
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
3aa82d5e63 Codechange: Use EnumBitSet for RoadStopStatusFlags. (#14068) 2025-04-21 20:16:23 +01:00
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
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
5b2754fdee Change: Use standard boolean toggle buttons for game options toggles. 2025-04-21 16:23:11 +01:00
d89753b88d Codechange: Add dedicated widget for boolean toggle buttons. 2025-04-21 16:23:11 +01:00
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
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
788845f731 Change: Allow Double-Ctrl+Click on default size box to clear saved size. (#14055) 2025-04-21 14:16:29 +01:00
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
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
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
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
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
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
394adb654e Codechange: Move GUI parts of badges to a separate file. (#14023) 2025-04-18 17:20:31 +01:00
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
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
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
378ea52ac6 Codechange: Use EnumBitSet for CzechChooseFlags. 2025-04-16 19:44:28 +01:00
ea0817390f Codechange: Use EnumBitSet for CzechAllowFlags. 2025-04-16 19:44:28 +01:00
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
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
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
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
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
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
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
34b1f7a992 Fix: Make GrfMsg() behave like Debug() when not loading NewGRFs. (#13991)
GrfMsg() outputs the currently loading NewGRF and current line/sprite number. This is invalid when not NewGRFs are not actually being loaded.
2025-04-12 13:05:33 +01:00
1744156149 Change: Queue content ID information requests. (#13990)
Instead of requesting content one ID at a time, queue them up to be requested in one go.

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

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

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

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

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

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

---------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CCountedPtr provided much more (untested) functionality than used.

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

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

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

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

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

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

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

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

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

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

* Codechange: Replace various uses of SB with AssignBit

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

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

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

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

Codefix #12860: Update comments

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

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

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

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

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

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

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

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

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

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

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

This is not normally noticeable as framerect padding is only 2 extra pixels
2024-06-22 15:42:13 +00:00
Björn Wärmedal
e0bcb54a4b Change: Allow bribing local authority when other company has exclusive rights (#12763) 2024-06-22 07:51:03 -04:00
translators
49d47b3b74 Update: Translations from eints
greek: 2 changes by gh658804
dutch: 2 changes by Afoklala
lithuanian: 4 changes by khamper
french: 9 changes by Lishouuu
2024-06-22 04:40:41 +00:00
translators
64781df29f Update: Translations from eints
english (us): 2 changes by 2TallTyler
2024-06-21 04:43:18 +00:00
translators
e3e215b249 Update: Translations from eints
german: 3 changes by Wuzzy2
portuguese (brazilian): 4 changes by pasantoro
2024-06-20 04:41:06 +00:00
translators
2dab9ac7a5 Update: Translations from eints
swedish: 4 changes by joeax910
catalan: 2 changes by J0anJosep
2024-06-19 04:42:11 +00:00
b56775f576 Codechange: Avoid making copies of intermediate layout runs. (#12796)
The vector of runs is not used after it is passed to the ParagraphLayout class, so pass with std::move to avoid an unnecessary copy.
2024-06-17 22:58:52 +01:00
731c56d116 Codefix: Add missing const inside script functions. (#12794)
Scripts do not modify items directly, marking them const enforces this.
2024-06-17 07:19:56 +01:00
translators
7db70f9c3f Update: Translations from eints
english (au): 2 changes by krysclarke
norwegian (bokmal): 6 changes by eriksorngard
korean: 3 changes by telk5093
russian: 2 changes by Ln-Wolf
finnish: 3 changes by hpiirai
portuguese: 2 changes by azulcosta
portuguese (brazilian): 2 changes by pasantoro
polish: 5 changes by pAter-exe
2024-06-17 04:43:34 +00:00
Tyler Trahan
e3156546fa Codefix: Don't claim to allocate new waypoint when just checking (#12792) 2024-06-16 16:07:57 -04:00
2f54904bab Codefix: Incorrect indentation of NWidgetParts in load/save windows. (#12791)
Fix to use the "standard" layout of 1 tab for nesting widgets and 2 tabs for attributes that wrap on to the next line.
2024-06-16 18:54:19 +01:00
ladysadie
2bc3cc5b67 Codechange: Compiler check for _fios_colours/DetailedFileType (#12781) 2024-06-16 08:54:41 +02:00
translators
0e7916a51b Update: Translations from eints
greek: 2 changes by gh658804
lithuanian: 1 change by khamper
2024-06-16 04:41:19 +00:00
Rubidium
b18d8d6574 Fix: ensure revision mismatch also considers random debugging status 2024-06-15 23:14:45 +02:00
merni-ns
0409577277 Add: Setting to disable warning for old vehicles (#12714) 2024-06-15 17:14:29 -04:00
ladysadie
45d1f9aa80 Doc: Explain comment alignment in CODINGSTYLE.md 2024-06-15 17:13:42 -04:00
Tyler Trahan
d8771b3f68 Change: Don't use house construction states in Scenario Editor (#12730) 2024-06-15 17:11:00 -04:00
Tyler Trahan
4cbaac6dac Fix #10239: Use elevated snow height for roads on flat foundations (#12776) 2024-06-15 17:10:39 -04:00
Loïc Guilloux
d7137651f2 Fix #12787: boostrap doesn't have main vindow (#12788) 2024-06-15 20:39:15 +00:00
b991a399ef Codechange: Split MakeNWidget to improve readability. (#12785)
Split MakeNWidget() into two stages, widget-creation and attribute-applying, to reduce function size and make it clearer.
2024-06-15 20:10:52 +01:00
22d70f9334 Codechange: Pass NewGRF ByteReader by reference. (#12786)
ByteReader must be present and not null, so don't use a pointer.
2024-06-15 10:55:26 +01:00
b68172c225 Codechange: Use std::endian instead of TTD_ENDIAN where trivial. (#12778) 2024-06-15 10:24:17 +01:00
f9f07e9001 Fix #12775: Text truncated incorrectly on Windows. (#12782)
Caused by a -1 in the wrong place, which moved glyphs left one pixel.
2024-06-14 16:32:31 +01:00
7b7e00123e Codechange: Shuffle RoadStop members to reduce size.
Size is reduced from 40 bytes to 32 bytes on 64 bit platforms.
2024-06-14 13:32:08 +01:00
77f62e0c90 Codechange: Shuffle OrderList members to reduce size.
Size is reduced from 40 bytes to 32 bytes on 64 bit platforms.
2024-06-14 13:32:08 +01:00
translators
219995c643 Update: Translations from eints
polish: 1 change by pAter-exe
2024-06-13 04:42:16 +00:00
55314513ce Codechange: Pass NWidgetParts as span instead of begin/end pointers. (#12779) 2024-06-12 23:08:35 +01:00
translators
81b5a7c7c6 Update: Translations from eints
german: 62 changes by Wuzzy2
2024-06-12 04:42:02 +00:00
Tyler Trahan
68f7d585b4 Doc: Remove resolved issue #4415 from known-bugs.txt (#12773) 2024-06-11 11:35:10 -04:00
4cf6d1dd79 Codechange: Pass WindowDesc by reference instead of pointer. (#12771)
WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
2024-06-11 08:58:03 +01:00
translators
18bce69623 Update: Translations from eints
galician: 3 changes by pvillaverde
danish: 1 change by bscargo
polish: 5 changes by pAter-exe
2024-06-10 04:43:42 +00:00
1358 changed files with 104152 additions and 87230 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. 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') * 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 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') * This PR affects the GS/AI API? (label 'needs review: Script API')
* ai_changelog.hpp, game_changelog.hpp need updating. * ai_changelog.hpp, game_changelog.hpp need updating.
* The compatibility wrappers (compat_*.nut) 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.txt | grep '^[0-9]' | awk 'BEGIN { show="false" } // { if (show=="true") print $0; if ($1=="'$tag'") show="true"} ' | grep "$grep" | head -n1 | sed 's/ .*//')
cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9]+.[0-9]+/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }'
exit 0
fi
# In all other cases, show the git log of the last 7 days
revdate=$(git log -1 --pretty=format:"%ci")
last_week=$(date -d "$revdate -7days" +"%Y-%m-%d %H:%M")
git log --after="${last_week}" --pretty=fuller

View File

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

View File

@@ -26,8 +26,8 @@ jobs:
matrix: matrix:
include: include:
- name: Clang - name: Clang
compiler: clang-15 compiler: clang
cxxcompiler: clang++-15 cxxcompiler: clang++
libraries: libsdl2-dev libraries: libsdl2-dev
- name: GCC - SDL2 - name: GCC - SDL2
compiler: gcc compiler: gcc
@@ -80,10 +80,8 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- os: windows-latest - arch: x86
arch: x86 - arch: x64
- os: windows-latest
arch: x64
name: Windows (${{ matrix.arch }}) name: Windows (${{ matrix.arch }})
@@ -91,7 +89,6 @@ jobs:
secrets: inherit secrets: inherit
with: with:
os: ${{ matrix.os }}
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
check_annotations: check_annotations:

View File

@@ -10,18 +10,32 @@ jobs:
emscripten: emscripten:
name: CI name: CI
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
container: 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 image: emscripten/emsdk:3.1.57
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Fix dubious ownership
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Update to modern GCC
run: |
apt-get update
apt-get install -y gcc-12 g++-12
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100
- name: Setup cache - name: Setup cache
uses: actions/cache@v4 uses: actions/cache@v4
with: 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 path: /emsdk/upstream/emscripten/cache
key: 3.1.57-${{ runner.os }} key: 3.1.57-${{ runner.os }}

View File

@@ -23,7 +23,7 @@ jobs:
linux: linux:
name: CI name: CI
runs-on: ubuntu-latest runs-on: ubuntu-24.04
env: env:
CC: ${{ inputs.compiler }} CC: ${{ inputs.compiler }}
CXX: ${{ inputs.cxxcompiler }} CXX: ${{ inputs.cxxcompiler }}
@@ -60,6 +60,9 @@ jobs:
libicu-dev \ libicu-dev \
liblzma-dev \ liblzma-dev \
liblzo2-dev \ liblzo2-dev \
libogg-dev \
libopus-dev \
libopusfile-dev \
${{ inputs.libraries }} \ ${{ inputs.libraries }} \
zlib1g-dev \ zlib1g-dev \
# EOF # EOF

View File

@@ -21,7 +21,7 @@ jobs:
macos: macos:
name: CI name: CI
runs-on: macos-14 runs-on: macos-latest
env: env:
MACOSX_DEPLOYMENT_TARGET: 10.13 MACOSX_DEPLOYMENT_TARGET: 10.13

View File

@@ -37,6 +37,9 @@ jobs:
mingw-w64-${{ inputs.arch }}-libpng mingw-w64-${{ inputs.arch }}-libpng
mingw-w64-${{ inputs.arch }}-lld mingw-w64-${{ inputs.arch }}-lld
mingw-w64-${{ inputs.arch }}-ninja mingw-w64-${{ inputs.arch }}-ninja
mingw-w64-${{ inputs.arch }}-libogg
mingw-w64-${{ inputs.arch }}-opus
mingw-w64-${{ inputs.arch }}-opusfile
- name: Install OpenGFX - name: Install OpenGFX
shell: bash shell: bash

View File

@@ -9,27 +9,6 @@ env:
CTEST_OUTPUT_ON_FAILURE: 1 CTEST_OUTPUT_ON_FAILURE: 1
jobs: 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: macos:
strategy: strategy:
fail-fast: false fail-fast: false
@@ -69,7 +48,6 @@ jobs:
check_annotations: check_annotations:
name: Check Annotations name: Check Annotations
needs: needs:
- linux
- macos - macos
- mingw - mingw

View File

@@ -6,9 +6,6 @@ on:
arch: arch:
required: true required: true
type: string type: string
os:
required: true
type: string
env: env:
CTEST_OUTPUT_ON_FAILURE: 1 CTEST_OUTPUT_ON_FAILURE: 1
@@ -17,7 +14,7 @@ jobs:
windows: windows:
name: CI name: CI
runs-on: ${{ inputs.os }} runs-on: windows-latest
steps: steps:
- name: Checkout - name: Checkout

View File

@@ -54,6 +54,8 @@ jobs:
libicu-dev \ libicu-dev \
liblzma-dev \ liblzma-dev \
liblzo2-dev \ liblzo2-dev \
libopus-dev \
libopusfile-dev \
libsdl2-dev \ libsdl2-dev \
zlib1g-dev \ zlib1g-dev \
# EOF # EOF
@@ -85,6 +87,7 @@ jobs:
with: with:
languages: cpp languages: cpp
config-file: ./.github/codeql/codeql-config.yml config-file: ./.github/codeql/codeql-config.yml
trap-caching: false
- name: Build - name: Build
run: | run: |

View File

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

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

View File

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

View File

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

View File

@@ -18,7 +18,7 @@ jobs:
source: source:
name: Source name: Source
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
outputs: outputs:
version: ${{ steps.metadata.outputs.version }} version: ${{ steps.metadata.outputs.version }}
@@ -90,10 +90,10 @@ jobs:
- name: Generate metadata - name: Generate metadata
id: metadata id: metadata
shell: bash
run: | run: |
echo "::group::Prepare metadata files" echo "::group::Prepare metadata files"
cmake -DGENERATE_OTTDREV=1 -P cmake/scripts/FindVersion.cmake cmake -DGENERATE_OTTDREV=1 -P cmake/scripts/FindVersion.cmake
./.github/changelog.sh > .changelog
TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date
cat .ottdrev | cut -f 1 -d$'\t' > .version cat .ottdrev | cut -f 1 -d$'\t' > .version
@@ -103,6 +103,8 @@ jobs:
FOLDER="${{ env.FOLDER_RELEASES }}" FOLDER="${{ env.FOLDER_RELEASES }}"
TRIGGER_TYPE="new-tag" TRIGGER_TYPE="new-tag"
python3 ./.github/changelog.py "$(cat .version)" > .changelog
else else
IS_TAG="false" IS_TAG="false"
@@ -124,10 +126,17 @@ jobs:
FOLDER="${{ env.FOLDER_BRANCHES }}/${BRANCH}" FOLDER="${{ env.FOLDER_BRANCHES }}/${BRANCH}"
TRIGGER_TYPE="new-branch" TRIGGER_TYPE="new-branch"
fi 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 fi
mkdir -p build/bundles mkdir -p build/bundles
cp .changelog build/bundles/changelog.txt cp .changelog build/bundles/changelog.md
cp .release_date build/bundles/released.txt cp .release_date build/bundles/released.txt
cp README.md build/bundles/README.md cp README.md build/bundles/README.md
echo "::endgroup::" echo "::endgroup::"

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.17)
if(NOT BINARY_NAME) if(NOT BINARY_NAME)
set(BINARY_NAME openttd) set(BINARY_NAME openttd)
@@ -51,9 +51,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS YES)
# An empty target for the tools # An empty target for the tools
add_custom_target(tools) add_custom_target(tools)
include(Endian)
add_endian_definition()
include(CompileFlags) include(CompileFlags)
compile_flags() compile_flags()
@@ -135,26 +132,26 @@ endif()
# Breakpad doesn't support emscripten. # Breakpad doesn't support emscripten.
if(NOT EMSCRIPTEN) if(NOT EMSCRIPTEN)
find_package(unofficial-breakpad) find_package(unofficial-breakpad NO_MODULE)
endif() endif()
if(NOT OPTION_DEDICATED) if(NOT OPTION_DEDICATED)
if(NOT WIN32) if(WIN32)
find_package(Xaudio2)
else()
find_package(Allegro) find_package(Allegro)
if(NOT APPLE) if(NOT APPLE)
find_package(Freetype) find_package(Freetype)
find_package(SDL2) find_package(SDL2)
if(NOT SDL2_FOUND)
find_package(SDL)
endif()
find_package(Fluidsynth) find_package(Fluidsynth)
if(Freetype_FOUND) if(Freetype_FOUND)
find_package(Fontconfig) find_package(Fontconfig)
endif() endif()
find_package(Harfbuzz) find_package(Harfbuzz)
find_package(ICU OPTIONAL_COMPONENTS i18n) find_package(ICU OPTIONAL_COMPONENTS i18n uc)
endif() endif()
endif() endif()
find_package(OpusFile)
endif() endif()
if(APPLE) if(APPLE)
enable_language(OBJCXX) enable_language(OBJCXX)
@@ -176,7 +173,6 @@ if(MSVC)
endif() endif()
find_package(SSE) find_package(SSE)
find_package(Xaudio2)
find_package(Grfcodec) find_package(Grfcodec)
@@ -186,8 +182,8 @@ check_ipo_supported(RESULT IPO_FOUND)
show_options() show_options()
if(UNIX AND NOT APPLE AND NOT OPTION_DEDICATED) if(UNIX AND NOT APPLE AND NOT OPTION_DEDICATED)
if(NOT SDL_FOUND AND NOT SDL2_FOUND AND NOT ALLEGRO_FOUND) if(NOT SDL2_FOUND AND NOT ALLEGRO_FOUND)
message(FATAL_ERROR "SDL, SDL2 or Allegro is required for this platform") message(FATAL_ERROR "SDL2 or Allegro is required for this platform")
endif() endif()
if(HARFBUZZ_FOUND AND NOT ICU_i18n_FOUND) if(HARFBUZZ_FOUND AND NOT ICU_i18n_FOUND)
message(WARNING "HarfBuzz depends on ICU i18n to function; HarfBuzz will be disabled") message(WARNING "HarfBuzz depends on ICU i18n to function; HarfBuzz will be disabled")
@@ -235,8 +231,6 @@ endif()
include(CTest) include(CTest)
include(SourceList) include(SourceList)
# Needed by rev.cpp
include_directories(${CMAKE_SOURCE_DIR}/src)
# Needed by everything that uses Squirrel # Needed by everything that uses Squirrel
include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/squirrel/include) include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/squirrel/include)
@@ -266,6 +260,7 @@ target_precompile_headers(openttd_lib
src/stdafx.h src/stdafx.h
src/core/format.hpp 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}/bin)
add_subdirectory(${CMAKE_SOURCE_DIR}/src) add_subdirectory(${CMAKE_SOURCE_DIR}/src)
@@ -305,7 +300,6 @@ if(IPO_FOUND)
set_target_properties(openttd PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO True) set_target_properties(openttd PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO True)
endif() endif()
set_target_properties(openttd PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") set_target_properties(openttd PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
process_compile_flags()
include(LinkPackage) include(LinkPackage)
link_package(PNG TARGET PNG::PNG ENCOURAGED) link_package(PNG TARGET PNG::PNG ENCOURAGED)
@@ -319,18 +313,19 @@ if(NOT WIN32 AND NOT EMSCRIPTEN)
endif() endif()
if(NOT EMSCRIPTEN) if(NOT EMSCRIPTEN)
link_package(unofficial-breakpad TARGET unofficial::breakpad::libbreakpad_client ENCOURAGED) link_package(unofficial-breakpad TARGET unofficial::breakpad::libbreakpad_client)
endif() endif()
if(NOT OPTION_DEDICATED) if(NOT OPTION_DEDICATED)
link_package(Fluidsynth) link_package(Fluidsynth)
link_package(SDL)
link_package(SDL2 TARGET SDL2::SDL2) link_package(SDL2 TARGET SDL2::SDL2)
link_package(Allegro) link_package(Allegro)
link_package(FREETYPE TARGET Freetype::Freetype) link_package(FREETYPE TARGET Freetype::Freetype)
link_package(Fontconfig TARGET Fontconfig::Fontconfig) link_package(Fontconfig TARGET Fontconfig::Fontconfig)
link_package(Harfbuzz TARGET harfbuzz::harfbuzz) link_package(Harfbuzz TARGET harfbuzz::harfbuzz)
link_package(ICU_i18n) link_package(ICU_i18n)
link_package(ICU_uc)
link_package(OpusFile TARGET OpusFile::opusfile)
if(SDL2_FOUND AND OPENGL_FOUND AND UNIX) if(SDL2_FOUND AND OPENGL_FOUND AND UNIX)
# SDL2 dynamically loads OpenGL if needed, so do not link to OpenGL when # SDL2 dynamically loads OpenGL if needed, so do not link to OpenGL when
@@ -388,13 +383,14 @@ if(EMSCRIPTEN)
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CREDITS.md@/CREDITS.md") target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CREDITS.md@/CREDITS.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CONTRIBUTING.md@/CONTRIBUTING.md") target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CONTRIBUTING.md@/CONTRIBUTING.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/COPYING.md@/COPYING.md") target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/COPYING.md@/COPYING.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/known-bugs.txt@/known-bugs.txt") target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/known-bugs.md@/known-bugs.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/changelog.txt@/changelog.txt") target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/changelog.md@/changelog.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/admin_network.md@/docs/admin_network.md") target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/admin_network.md@/docs/admin_network.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/debugging_desyncs.md@/docs/debugging_desyncs.md") target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/debugging_desyncs.md@/docs/debugging_desyncs.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/desync.md@/docs/desync.md") target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/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/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/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/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/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") 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. * Function names use [CamelCase](http://www.wikipedia.org/wiki/Camelcase) without underscores.
* Opening curly bracket **{** for a function starts on the next line. * Opening curly bracket **{** for a function starts on the next line.
* Use Foo() instead of Foo(void). * 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++ ```c++
void ThisIsAFunction() void ThisIsAFunction()
{ {
@@ -254,11 +256,44 @@ int Func();
* If you are writing one or more template class in the dedicated header file, use file.hpp for its name instead of file.h. This will let others know that it is template library (includes also implementation), not just header with declarations. * If you are writing one or more template class in the dedicated header file, use file.hpp for its name instead of file.h. This will let others know that it is template library (includes also implementation), not just header with declarations.
### Code Comment Vertical Alignment
When adding code or comments to an existing formatted section, follow the existing style if possible without editing the preexisting lines.
If your addition cannot be aligned with existing code, do not align the comments with anything and use only a single space between the code and the comment.
Good:
```c++
enum Vehicle {
BUS, ///< Take the bus.
+ CAR, ///< Drive your car.
BIKE, ///< Ride your bike
+ TRAIN, ///< Catch the train.
}
```
"Car" is shorter than Bike which allows you to easily align the new comment. "Train" is longer. It is *NOT* desirable to change the vertical comment alignment of this enum.
Bad:
```c++
enum Vehicle {
- BUS, ///< Take the bus.
- BIKE, ///< Ride your bike
+ BUS, ///< Take the bus.
+ CAR, ///< Drive your car.
+ BIKE, ///< Ride your bike
+ TRAIN, ///< Catch the train.
}
```
OpenTTD used to vertically-align inline Doxygen comments as shown above. OpenTTD has since stopped strictly following this rule to keep diffs smaller and reduce pollution to the git blame history for non-functional changes.
### Other important rules ### Other important rules
* Put a space before and after binary operators: "a + b", "a == b", "a & b", "a <<= b", etc.. Exceptions are ".", "->" and "[]" (no spaces) and "," (just space after it). * Put 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)". * 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. * Do not put external declarations in implementation (i.e. cpp) files.
* Use const where possible.
* Do not typedef enums and structs. * 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)". * 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. * Use "free(p)" instead of "if (p != nullptr) free(p)". "free(nullptr)" doesn't hurt anyone.
@@ -448,7 +483,7 @@ Do not mention two keywords; if two apply, pick one that best represents the com
The `<details>` part starts with a capital and does not end with a dot. The `<details>` part starts with a capital and does not end with a dot.
Try to be descriptive to what the player will notice, not to what is actually being changed in the code. Try to be descriptive to what the player will notice, not to what is actually being changed in the code.
See `changelog.txt` for inspiration. See `changelog.md` for inspiration.
To further structure the changelog, you can add components. Example are: To further structure the changelog, you can add components. Example are:
* "Network" for network specific changes. * "Network" for network specific changes.

View File

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

View File

@@ -310,7 +310,7 @@ INCLUDE_FILE_PATTERNS =
PREDEFINED = WITH_ZLIB \ PREDEFINED = WITH_ZLIB \
WITH_LZO \ WITH_LZO \
WITH_LIBLZMA \ WITH_LIBLZMA \
WITH_SDL \ WITH_SDL2 \
WITH_PNG \ WITH_PNG \
WITH_FONTCONFIG \ WITH_FONTCONFIG \
WITH_FREETYPE \ 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. 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 ## 1.2) OpenTTD gameplay manual
OpenTTD has a [community-maintained wiki](https://wiki.openttd.org/), including a gameplay manual and tips. OpenTTD has a [community-maintained wiki](https://wiki.openttd.org/), including a gameplay manual and tips.
## 1.3) Supported platforms ## 1.3) Supported platforms
OpenTTD has been ported to several platforms and operating systems. 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. Other platforms may also work (in particular various BSD systems), but we don't actively test or maintain these.
### 1.3.1) Legacy support ### 1.3.1) Legacy support
Platforms, languages and compilers change. 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. 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). 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 ### 1.4.1) Free graphics and sound files
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and 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. Please follow the readme of these packages about the installation procedure.
The Windows installer can optionally download and install these packages. The Windows installer can optionally download and install these packages.
### 1.4.2) Original Transport Tycoon Deluxe graphics and sound files ### 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. 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 - trgir.grf or TRGI.GRF
- trgtr.grf or TRGT.GRF - trgtr.grf or TRGT.GRF
### 1.4.3) Original Transport Tycoon Deluxe music ### 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. 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 - TTD for DOS: The GM.CAT file
- Transport Tycoon Original: The GM.CAT file, but rename it to GM-TTO.CAT - Transport Tycoon Original: The GM.CAT file, but rename it to GM-TTO.CAT
## 1.5) Add-on content / mods ## 1.5) Add-on content / mods
OpenTTD features multiple types of add-on content, which modify gameplay in different ways. 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). 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 ### 1.5.1) Social Integration
OpenTTD has the ability to load plugins to integrate with Social Platforms like Steam, Discord, etc. 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. See [OpenTTD's website](https://www.openttd.org), under Downloads, for what plugins are available.
### 1.6) OpenTTD directories ### 1.6) OpenTTD directories
OpenTTD uses its own directory structure to store game data, add-on content etc. 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). If you want to compile OpenTTD from source, instructions can be found in [COMPILING.md](./COMPILING.md).
## 2.0) Contact and Community ## 2.0) Contact and Community
'Official' channels '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. See the [multiplayer documentation](./docs/multiplayer.md) for more details.
### 2.2) Contributing to OpenTTD ### 2.2) Contributing to OpenTTD
We welcome contributors to OpenTTD. More information for contributors can be found in [CONTRIBUTING.md](./CONTRIBUTING.md) We welcome contributors to OpenTTD. More information for contributors can be found in [CONTRIBUTING.md](./CONTRIBUTING.md)
### 2.3) Reporting bugs ### 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. 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). 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). Instructions can be found in [debugging and reporting desyncs](./docs/debugging_desyncs.md).
### 2.4) Translating ### 2.4) Translating
OpenTTD is translated into many languages. Translations are added and updated via the [online translation tool](https://translator.openttd.org). OpenTTD is translated into many languages. Translations are added and updated via the [online translation tool](https://translator.openttd.org).
## 3.0) Licensing ## 3.0) Licensing
OpenTTD is licensed under the GNU General Public License version 2.0. 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. 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. See `cmake/3rdparty/llvm/LICENSE.txt` for the complete license text.
## 4.0 Credits ## 4.0) Credits
See [CREDITS.md](./CREDITS.md) 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_12.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_13.nut ${CMAKE_CURRENT_SOURCE_DIR}/compat_13.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_14.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) 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/>. * 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(" - AITown::GetLastMonthProduction's behaviour has slightly changed.");
AILog.Info(" - AISubsidy::GetDestination returns STATION_INVALID for awarded subsidies."); AILog.Info(" - AISubsidy::GetDestination returns STATION_INVALID for awarded subsidies.");
AILog.Info(" - AISubsidy::GetSource 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); return AIEngine.IsBuildable(engine_id);
} }
AIEngine._GetName <- AIEngine.GetName; AIEngine.GetNameCompat0_7 <- AIEngine.GetName;
AIEngine.GetName <- function(engine_id) AIEngine.GetName <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return null; 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) AIEngine.GetCargoType <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return 255; 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) AIEngine.CanRefitCargo <- function(engine_id, cargo_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return false; 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) AIEngine.CanPullCargo <- function(engine_id, cargo_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return false; 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) AIEngine.GetCapacity <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return -1; 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) AIEngine.GetReliability <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return -1; 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) AIEngine.GetMaxSpeed <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return -1; 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) AIEngine.GetPrice <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return -1; 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) AIEngine.GetMaxAge <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return -1; 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) AIEngine.GetRunningCost <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return -1; 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) AIEngine.GetPower <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return -1; 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) AIEngine.GetWeight <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return -1; 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) AIEngine.GetMaxTractiveEffort <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return -1; 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) AIEngine.GetDesignDate <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return -1; 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) AIEngine.GetVehicleType <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return AIVehicle.VT_INVALID; 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) AIEngine.IsWagon <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return false; 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) AIEngine.CanRunOnRail <- function(engine_id, track_rail_type)
{ {
if (!AIEngine.IsBuildable(engine_id)) return false; 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) AIEngine.HasPowerOnRail <- function(engine_id, track_rail_type)
{ {
if (!AIEngine.IsBuildable(engine_id)) return false; 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) AIEngine.GetRoadType <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return AIRoad.ROADTYPE_INVALID; 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) AIEngine.GetRailType <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return AIRail.RAILTYPE_INVALID; 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) AIEngine.IsArticulated <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return false; 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) AIEngine.GetPlaneType <- function(engine_id)
{ {
if (!AIEngine.IsBuildable(engine_id)) return -1; if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetPlaneType(engine_id); return AIEngine.GetPlaneTypeCompat0_7(engine_id);
} }
_AIWaypointList <- AIWaypointList; _AIWaypointList <- AIWaypointList;
@@ -256,139 +257,3 @@ class AIWaypointList extends _AIWaypointList {
::_AIWaypointList.constructor(AIWaypoint.WAYPOINT_RAIL); ::_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/>. * 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) AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id)
{ {
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false; 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) AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id)
{ {
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false; 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 <- AIBridgeList.HasNext <-
@@ -59,10 +59,10 @@ function()
return !this.IsEnd(); return !this.IsEnd();
} }
AIIndustry._IsCargoAccepted <- AIIndustry.IsCargoAccepted; AIIndustry.IsCargoAcceptedCompat1_0 <- AIIndustry.IsCargoAccepted;
AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id) 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; AIAbstractList <- AIList;
@@ -70,77 +70,3 @@ AIAbstractList <- AIList;
AIList.ChangeItem <- AIList.SetValue; AIList.ChangeItem <- AIList.SetValue;
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF; 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/>. * 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) 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_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID 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/>. * 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."); /* This file contains code to downgrade the API from 1.11 to 1.10. */
/* 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/>. * 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."); /* This file contains code to downgrade the API from 12 to 1.11. */
/* 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,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/>. * 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."); /* This file contains code to downgrade the API from 1.3 to 1.2. */
/* 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,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/>. * 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."); /* This file contains code to downgrade the API from 1.4 to 1.3. */
/* 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,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/>. * 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."); /* This file contains code to downgrade the API from 1.5 to 1.4. */
/* 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,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/>. * 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."); /* This file contains code to downgrade the API from 1.6 to 1.5. */
/* 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,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/>. * 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."); /* This file contains code to downgrade the API from 1.7 to 1.6. */
/* 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,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/>. * 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."); /* This file contains code to downgrade the API from 1.8 to 1.7. */
/* 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,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/>. * 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.GetNameCompat1_8 <- AIBridge.GetName;
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id) 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.CreateGroupCompat1_8 <- AIGroup.CreateGroup;
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type) AIGroup.CreateGroup <- function(vehicle_type)
{ {
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID); return AIGroup.CreateGroupCompat1_8(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/>. * 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."); /* This file contains code to downgrade the API from 1.10 to 1.9. */
/* 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,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/>. * 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.HasRoadTypeCompat12 <- AIRoad.HasRoadType;
AIRoad._HasRoadType <- AIRoad.HasRoadType;
AIRoad.HasRoadType <- function(tile, road_type) AIRoad.HasRoadType <- function(tile, road_type)
{ {
local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) { foreach (rt, _ in list) {
if (AIRoad._HasRoadType(tile, rt)) { if (AIRoad.HasRoadTypeCompat12(tile, rt)) {
return true; 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/>. * 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/>. * 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_12.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_13.nut ${CMAKE_CURRENT_SOURCE_DIR}/compat_13.nut
${CMAKE_CURRENT_SOURCE_DIR}/compat_14.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) 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/>. * 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.ChangeBankBalanceCompat1_10 <- GSCompany.ChangeBankBalance;
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type) GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{ {
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID); return GSCompany.ChangeBankBalanceCompat1_10(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
} }

View File

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

View File

@@ -5,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/>. * 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) 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). */ /* 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; if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL;
return GSTown._SetGrowthRate(town_id, days_between_town_growth); return GSTown.SetGrowthRateCompat1_3(town_id, days_between_town_growth);
}
/* 1.5 adds a game element reference to the news. */
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company)
{
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
}
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
} }

View File

@@ -5,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/>. * 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.CreateCompat1_4 <- GSNews.Create;
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company) GSNews.Create <- function(type, text, company)
{ {
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0); return GSNews.CreateCompat1_4(type, text, company, GSNews.NR_NONE, 0);
}
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
} }

View File

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

View File

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

View File

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

View File

@@ -5,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/>. * 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.GetNameCompat1_8 <- GSBridge.GetName;
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id) GSBridge.GetName <- function(bridge_id)
{ {
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL); return GSBridge.GetNameCompat1_8(bridge_id, GSVehicle.VT_RAIL);
}
/* 1.11 adds a tile parameter. */
GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance;
GSCompany.ChangeBankBalance <- function(company, delta, expenses_type)
{
return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID);
}
/* 13 really checks RoadType against RoadType */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
} }

View File

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

View File

@@ -5,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/>. * 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.HasRoadTypeCompat12 <- GSRoad.HasRoadType;
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type) GSRoad.HasRoadType <- function(tile, road_type)
{ {
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type)); local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) { foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) { if (GSRoad.HasRoadTypeCompat12(tile, rt)) {
return true; 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/>. * 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/>. * 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"); }
}

File diff suppressed because it is too large Load Diff

View File

@@ -10,6 +10,7 @@ macro(compile_flags)
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options( add_compile_options(
/Zc:preprocessor # Needed for __VA_OPT__() in macros.
/MP # Enable multi-threaded compilation. /MP # Enable multi-threaded compilation.
/FC # Display the full path of source code files passed to the compiler in diagnostics. /FC # Display the full path of source code files passed to the compiler in diagnostics.
) )
@@ -55,6 +56,11 @@ macro(compile_flags)
# This flag disables the broken optimisation to work around the bug # This flag disables the broken optimisation to work around the bug
add_compile_options(/d2ssa-rse-) add_compile_options(/d2ssa-rse-)
endif() endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(
-Wno-multichar
)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_compile_options( add_compile_options(
-W -W
@@ -74,6 +80,10 @@ macro(compile_flags)
# We use 'ABCD' multichar for SaveLoad chunks identifiers # We use 'ABCD' multichar for SaveLoad chunks identifiers
-Wno-multichar -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 # Ninja processes the output so the output from the compiler
@@ -100,10 +110,6 @@ macro(compile_flags)
# about its own optimized code in some places. # about its own optimized code in some places.
"-fno-strict-overflow" "-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 # -flifetime-dse=2 (default since GCC 6) doesn't play
# well with our custom pool item allocator # well with our custom pool item allocator
"$<$<BOOL:${LIFETIME_DSE_FOUND}>:-flifetime-dse=1>" "$<$<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} PATHS ${PC_LZO_LIBRARY_DIRS}
) )
# With vcpkg, the library path should contain both 'debug' and 'optimized' include(FixVcpkgLibrary)
# entries (see target_link_libraries() documentation for more information) FixVcpkgLibrary(LZO)
#
# NOTE: we only patch up when using vcpkg; the same issue might happen
# when not using vcpkg, but this is non-trivial to fix, as we have no idea
# what the paths are. With vcpkg we do. And we only official support vcpkg
# with Windows.
#
# NOTE: this is based on the assumption that the debug file has the same
# name as the optimized file. This is not always the case, but so far
# experiences has shown that in those case vcpkg CMake files do the right
# thing.
if(VCPKG_TOOLCHAIN AND LZO_LIBRARY AND LZO_LIBRARY MATCHES "${VCPKG_INSTALLED_DIR}")
if(LZO_LIBRARY MATCHES "/debug/")
set(LZO_LIBRARY_DEBUG ${LZO_LIBRARY})
string(REPLACE "/debug/lib/" "/lib/" LZO_LIBRARY_RELEASE ${LZO_LIBRARY})
else()
set(LZO_LIBRARY_RELEASE ${LZO_LIBRARY})
string(REPLACE "/lib/" "/debug/lib/" LZO_LIBRARY_DEBUG ${LZO_LIBRARY})
endif()
include(SelectLibraryConfigurations)
select_library_configurations(LZO)
endif()
set(LZO_VERSION ${PC_LZO_VERSION}) set(LZO_VERSION ${PC_LZO_VERSION})

41
cmake/FindOgg.cmake Normal file
View File

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

41
cmake/FindOpus.cmake Normal file
View File

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

44
cmake/FindOpusFile.cmake Normal file
View File

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

View File

@@ -2,6 +2,7 @@
# SSE version (SSE 2.0, SSSE 3.0). # SSE version (SSE 2.0, SSSE 3.0).
include(CheckCXXSourceCompiles) include(CheckCXXSourceCompiles)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(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") 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; }" int main() { return 0; }"
SSE_FOUND SSE_FOUND
) )
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

@@ -16,8 +16,11 @@
; - `openttd -I <name>` starts OpenTTD with the given set (case sensitive) ; - `openttd -I <name>` starts OpenTTD with the given set (case sensitive)
; - adding `graphicsset = <name>` to the misc section of openttd.cfg makes ; - adding `graphicsset = <name>` to the misc section of openttd.cfg makes
; OpenTTD start with that graphics set by default ; OpenTTD start with that graphics set by default
; - there is a command line tool for all platforms called md5sum that can ; - `grfid -m` can give the GRF file MD5 checksums that you need
; create the MD5 checksum 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 ; - 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 ; 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 ; 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 palette = DOS
; preferred blitter, optional; either 8bpp (default) or 32bpp. ; preferred blitter, optional; either 8bpp (default) or 32bpp.
blitter = 8bpp blitter = 8bpp
; url, optional
url = https://github.com/my/baseset
; The files section lists the files that replace sprites. ; The files section lists the files that replace sprites.
; The file names are case sensitive. ; 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). * 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. * 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 `ApiVersions` in `src/ai/ai_info.hpp` and `src/game/game_info.hpp`.
* 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`.
* 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`.
* 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. * Add a note to `src/saveload/saveload.h` about which savegame version is used in the branch.
* If this is a later RC or release build and the release branch already exists, you'll need to backport fixes and language from master to this branch, which were merged after the branch diverged from master. You can use these two helper scripts: https://github.com/OpenTTD/scripts/tree/main/backport * If this is a 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
@@ -20,7 +20,7 @@ This guide is for OpenTTD developers/maintainers, to release a new version of Op
## Step 1: Prepare changelog documentation ## Step 1: Prepare changelog documentation
1. Update the [changelog](../changelog.txt) with new changes since the last release. 1. Update the [changelog](../changelog.md) with new changes since the last release.
* Changelog entries are typically PR titles, but can be edited to be more helpful without context. * Changelog entries are typically PR titles, but can be edited to be more helpful without context.
* Don't include fixes to things which haven't previously been released (like fixes to features which are in the same changelog). * Don't include fixes to things which haven't previously been released (like fixes to features which are in the same changelog).
* Order the entries by importance: `Feature > Add > Change > Fix`, then numerically by PR number. * Order the entries by importance: `Feature > Add > Change > Fix`, then numerically by PR number.

426
known-bugs.md Normal file
View File

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

View File

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

Binary file not shown.

View File

@@ -1,6 +1,6 @@
# OpenTTD TrueType font # 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. 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 @@
4f03553f614a06d86dc06376db3353c7 eb8390a0569e66ec417c64ad254f9d05

View File

@@ -18,8 +18,10 @@ if(GRFCODEC_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/oneway.nfo ${CMAKE_CURRENT_SOURCE_DIR}/oneway.nfo
${CMAKE_CURRENT_SOURCE_DIR}/openttd.nfo ${CMAKE_CURRENT_SOURCE_DIR}/openttd.nfo
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui.nfo ${CMAKE_CURRENT_SOURCE_DIR}/openttdgui.nfo
${CMAKE_CURRENT_SOURCE_DIR}/overlay_rocks.nfo
${CMAKE_CURRENT_SOURCE_DIR}/palette.nfo ${CMAKE_CURRENT_SOURCE_DIR}/palette.nfo
${CMAKE_CURRENT_SOURCE_DIR}/roadstops.nfo ${CMAKE_CURRENT_SOURCE_DIR}/roadstops.nfo
${CMAKE_CURRENT_SOURCE_DIR}/road_waypoints.nfo
${CMAKE_CURRENT_SOURCE_DIR}/signals.nfo ${CMAKE_CURRENT_SOURCE_DIR}/signals.nfo
${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.nfo ${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.nfo
${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.nfo ${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.nfo
@@ -41,7 +43,13 @@ if(GRFCODEC_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_road.png ${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_road.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_tram.png ${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_tram.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_group_livery.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}/roadstops.png
${CMAKE_CURRENT_SOURCE_DIR}/road_waypoints.png
${CMAKE_CURRENT_SOURCE_DIR}/signals.png ${CMAKE_CURRENT_SOURCE_DIR}/signals.png
${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.png ${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.png
${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.png ${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.png

View File

@@ -671,9 +671,9 @@
// U+2026: Horizontal Ellipsis // 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 * 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 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 -1 sprites/mono.png 8bpp 265 270 7 13 0 0 normal
// U+2039: Single Left-Pointing Angle Quotation Mark // U+2039: Single Left-Pointing Angle Quotation Mark
@@ -840,3 +840,13 @@
-1 sprites/chars.png 8bpp 630 400 6 21 0 -2 normal -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 325 270 7 13 0 0 normal
-1 sprites/mono.png 8bpp 340 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
// U+E29B: Town
// U+E29C: City
-1 * 6 12 01 00 02 9B E2
-1 sprites/chars.png 8bpp 20 430 10 10 0 0 normal
-1 sprites/chars.png 8bpp 40 430 10 10 0 0 normal

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -98,3 +98,5 @@
#include "mono.nfo" #include "mono.nfo"
#include "tunnel_portals.nfo" #include "tunnel_portals.nfo"
#include "palette.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/>. // 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 * 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 66 8 64 31 -31 7 normal
-1 sprites/openttdgui.png 8bpp 146 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 -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 567 440 12 10 0 0 normal
-1 sprites/openttdgui.png 8bpp 581 440 10 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 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

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