Commit Graph
492 Commits
Author SHA1 Message Date
froschandfrosch fda93b6f35 Codechange: Add format_append as short-hand to format_to + back_inserter. 2025-04-29 20:26:23 +02:00
froschandGitHub 26db4ccf09 Codechange: Turn bit-stuffed FiosType enum into a struct. (#14019) 2025-04-18 15:20:55 +02:00
Peter NelsonandGitHub 936d78fefc Codefix: Avoid uppercase characters in variable names. (#13985) 2025-04-10 07:19:27 +01:00
froschandGitHub 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
Peter NelsonandGitHub 325f7f9767 Codechange: Use EnumBitSet for GoodsEntry status. (#13899) 2025-03-26 21:22:33 +00:00
Peter NelsonandPeter Nelson 732109e444 Codechange: Use EnumBitSet for RoadTypes. 2025-03-25 20:15:48 +00:00
Peter NelsonandGitHub 79ef4e98fe Codechange: Use std::swap() instead of Swap() (#13883) 2025-03-24 23:47:34 +00:00
Peter NelsonandPeter Nelson 2909a14374 Codechange: Include table/strings.h in files that use StringIDs.
Be consistent with how and where the file is incldued.
2025-03-21 12:53:40 +00:00
Rubidiumandrubidium42 ec647975ad Cleanup: remove ancient FIXME comments 2025-03-16 05:42:29 +01:00
Peter NelsonandGitHub 8b39b23d2b Codechange: Use EnumBitSet for VehicleFlags. (#13793) 2025-03-13 08:38:54 +00:00
Peter NelsonandGitHub 91d22f7617 Codechange: Use EnumBitSet for VehStates. (#13755)
Renamed from VehStatus because pluralising that is weird.
2025-03-08 18:24:21 +00:00
Peter NelsonandGitHub 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
Peter NelsonandPeter Nelson 3cf9b15959 Codechange: Handle SnowTile state separately from ClearGround.
This removes the need for ClearGround to pretend that CLEAR_SNOW exists.
2025-02-25 08:22:46 +00:00
Rubidiumandrubidium42 24a7cde9cc Codechange: explicitly initialise Company member variables 2025-02-22 16:33:05 +01:00
Rubidiumandrubidium42 37d549d395 Codefix 35e58f68e4: afterload did not properly set airport rotation 2025-02-18 23:09:02 +01:00
Rubidiumandrubidium42 fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Rubidiumandrubidium42 1003967267 Codechange: strongly type TownID 2025-02-16 14:50:15 +01:00
Rubidiumandrubidium42 ab8177ea77 Codechange: strongly type CompanyID 2025-02-16 14:02:18 +01:00
Rubidiumandrubidium42 1ffc950e22 Codechange: use prefix operator++ for CompanyID iterations 2025-02-16 14:02:18 +01:00
Peter NelsonandGitHub 2d7d085e8e Codechange: Use EncodedString for error messages. (#13569) 2025-02-16 10:04:32 +00:00
Peter NelsonandGitHub 6cf7a899e9 Codechange: Use EnumBitSet for PauseMode. (#13553) 2025-02-14 08:30:04 +00:00
Peter NelsonandPeter Nelson f0777737af Fix #13459, Fix #13546: Crash when changing NewGRFs in game with picker window open. 2025-02-13 21:07:37 +00:00
Peter NelsonandPeter Nelson 75387b9e2b Codechange: Use EnumBitSet for StationFacility. 2025-02-13 18:03:13 +00:00
Rubidiumandrubidium42 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 TrahanandGitHub 521b860394 Feature: Prevent towns from upgrading individually-placed houses (#13270) 2025-02-09 20:37:06 +00:00
Peter NelsonandGitHub 1ed685b5c1 Codechange: Use EnumBitSet.Any(). (#13512) 2025-02-09 20:16:16 +00:00
Patric StoutandGitHub 86841ba1f0 Codechange: no longer add "src" to the include-path (#13511) 2025-02-09 19:43:15 +00:00
Rubidiumandrubidium42 01b639bb23 Codechange: replace instance of raw uint16_t with CompanyMask 2025-02-09 19:24:51 +01:00
Rubidiumandrubidium42 ec492cb267 Codechange: make CompanyMask a BaseBitSet implementation 2025-02-09 19:24:51 +01:00
Rubidiumandrubidium42 cd4482b5df Codechange: make TownID an enum 2025-02-09 18:05:01 +01:00
Rubidiumandrubidium42 1e24b41f22 Codechange: strongly type GroupID 2025-02-09 16:52:21 +01:00
Rubidiumandrubidium42 798e9f229c Codechange: strongly type DepotID 2025-02-09 16:52:21 +01:00
Rubidiumandrubidium42 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
Rubidiumandrubidium42 cb3db3cedd Codechange: strongly type ObjectID 2025-02-09 15:07:29 +01:00
Rubidiumandrubidium42 5f41bc0279 Codechange: put SourceType and SourceID into Source struct 2025-02-08 06:37:23 +01:00
Peter NelsonandPeter Nelson 2bb3f368e3 Codechange: Use EnumBitSet for IndustryBehaviours. 2025-02-07 12:30:06 +00:00
Jonathan G Rennisonandrubidium42 3ea4d1d4fc Fix #12912: CompanyProperties::inaugurated_year_calendar not saved 2025-02-03 08:09:45 +01:00
Peter NelsonandPeter 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 NelsonandGitHub 59354576d4 Codechange: Use EnumBitSet for LandscapeTypes and remove LandscapeID. (#13436) 2025-02-01 23:09:18 +00:00
Rubidiumandrubidium42 4ca1fe6c32 Codechange: replace MAX_UVALUE with std::numeric_limits::max 2025-02-01 01:29:02 +01:00
Peter NelsonandPeter Nelson 6c4ddb242a Codechange: Use EnumBitSet for EngineMiscFlags. 2025-01-31 18:55:31 +00:00
Peter NelsonandGitHub 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 NelsonandPeter Nelson 5ef495da78 Codechange: Use EnumBitSet for GroupFlags. 2025-01-29 21:46:39 +00:00
Rubidiumandrubidium42 4099acb946 Codechange: replace BSWAP32/BSWAP16 with std::byteswap 2025-01-28 19:22:12 +01:00
Rubidiumandrubidium42 e894a5880c Codechange: rename CargoID to CargoType and amend related variables/comments 2025-01-26 18:07:10 +01:00
Peter NelsonandGitHub 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
Peter NelsonandGitHub 4397aa3909 Codechange: Make StationType an enum class. (#13339) 2025-01-19 20:53:08 +00:00
Peter NelsonandGitHub 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
Peter NelsonandGitHub 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
Rubidiumandrubidium42 c0df898ac5 Codechange: do not implicitly convert during assignment to StrongType 2025-01-01 21:32:51 +01:00