1
0
Fork 0
Commit Graph

23685 Commits (ee45c8ec1d75e67466cf70e9d732eea8841f9c75)

Author SHA1 Message Date
translators 30ddbeed8d Update: Translations from eints
french: 21 changes by glx22
2025-02-09 04:40:46 +00:00
Rubidium 4cda9f900d Codechange: [Script] Use helper function over direct casting CompanyID
In the script's API `COMPANY_INVALID` has a value of -1, whereas the internal
game's `INVALID_COMPANY` has a value of 255. Since the script's API also has
a `COMPANY_SPECTATOR` with a value of 255, these enumerations cannot be easily
reconciled by casting. As such, replace all casts in the script API with
either ScriptCompany::FromScriptCompanyID or ScriptCompany::ToScriptCompanyID.

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

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

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

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

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

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

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

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

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

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

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

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

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

During Afterload, there are some calls that need the state of station tile flags to be correct which were executed before the station tile flags were set.
2024-12-27 14:27:55 +00:00
translators e76cc89255 Update: Translations from eints
spanish: 124 changes by MontyMontana
2024-12-27 04:42:38 +00:00
Peter Nelson 1faf60ae13
Fix #13199: -f command line parameter does not need a value. (#13200) 2024-12-27 00:16:34 +00:00
translators c5ec55b4ed Update: Translations from eints
luxembourgish: 2 changes by phreeze83
turkish: 33 changes by BeratSJ
2024-12-26 04:42:27 +00:00
SamuXarick ee860a5c8e Doc: Update some yapf inline comments 2024-12-24 20:43:46 +01:00
translators f74b0cf984 Update: Translations from eints
chinese (simplified): 2 changes by WenSimEHRP
2024-12-24 04:44:12 +00:00
Peter Nelson b35284d3dd
Fix 6a07f28103: Clearing animated tiles may lead to invalid state. (#13192) 2024-12-23 22:35:43 +01:00
Peter Nelson 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
Peter Nelson 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
Peter Nelson 2176d49a39
Revert: "Codechange: remove parameter which value can always be deduced" (#13183)
This reverts commit dfb74e25f7.
2024-12-21 19:49:02 +00:00
Peter Nelson 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
Peter Nelson 59680867c3 Codechange: Use structured bindings when iterating font_mapping. 2024-12-20 19:05:08 +00:00
Peter Nelson 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
translators 07fb13cd29 Update: Translations from eints
chinese (simplified): 154 changes by WenSimEHRP
2024-12-19 04:44:42 +00:00
Peter Nelson 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
Peter Nelson eacec144b0
Fix 56510b5d7b: CargoArray does need to be initialised... (#13168) 2024-12-12 19:33:55 +00:00
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
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
Peter Nelson 560ee2442d Add: Support sound effects in Ogg Opus format. 2024-12-06 18:41:35 +00:00
Peter Nelson 8b00661b22 Change: Add sound memory usage to framerate window. 2024-12-06 18:41:35 +00:00
Peter Nelson 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
Peter Nelson 7e8bcf44f7 Codechange: ProviderManager class to support self-registration of providers.
This is based loosely on TimerManager.
2024-12-06 18:41:35 +00:00
Peter Nelson bccf5343f4 Codechange: Use a type alias for mixer channel masking. 2024-12-06 18:41:35 +00:00
Peter Nelson 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
Peter Nelson cfb995b6e9
Codechange: Reimplement engine sort order with std::rotate. (#13124) 2024-12-05 22:17:40 +00:00
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
Peter Nelson 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
Peter Nelson 2ff18a4f05
Fix: String parameter not set when determining width of smallmap contour labels. (#13145) 2024-12-04 12:18:17 +00:00
Peter Nelson 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
Peter Nelson 9e182871c7 Add: Show house information in house placer. 2024-12-02 00:48:46 +00:00
Peter Nelson 041b9181f9 Codechange: Extract code to build cargo acceptance string for re-use. 2024-12-02 00:48:46 +00:00
Peter Nelson 2ede94bc40 Codechange: Adapt functions to get accepted cargo of prototype house. 2024-12-02 00:48:46 +00:00