Commit Graph

1341 Commits

Author SHA1 Message Date
Peter Nelson 2909a14374 Codechange: Include table/strings.h in files that use StringIDs.
Be consistent with how and where the file is incldued.
2025-03-21 12:53:40 +00:00
Peter Nelson 89948b941b Codechange: Use emplace_back instead of push_back. (#13855) 2025-03-20 17:39:10 +00:00
Rubidium ec647975ad Cleanup: remove ancient FIXME comments 2025-03-16 05:42:29 +01:00
Rubidium 754311a779 Codechange: use std::move when appropriate 2025-03-13 13:00:24 +01:00
Peter Nelson 8b39b23d2b Codechange: Use EnumBitSet for VehicleFlags. (#13793) 2025-03-13 08:38:54 +00:00
Rubidium 32b2de36ef Codefix: check the table header is actually being read 2025-03-12 17:55:34 +01:00
Peter Nelson 91d22f7617 Codechange: Use EnumBitSet for VehStates. (#13755)
Renamed from VehStatus because pluralising that is weird.
2025-03-08 18:24:21 +00:00
Peter Nelson 6d631d7a13 Fix f8b1e30: Fix recent savegames may have incorrect EngineFlags saved. (#13745)
Detect and update engines saved with invalid EngineFlags.
2025-03-05 17:58:03 +00:00
Loïc Guilloux 7723625823 Fix #13729, f8b1e30: Incorrect conversion of EngineFlags to EngineFlag (#13743) 2025-03-05 09:12:06 +00:00
Loïc Guilloux 0d4346c8dc Fix #13727, bdd1406: Incorrect ls.vehicle_names size for TTO saves (#13732) 2025-03-03 22:59:57 +00:00
Peter Nelson 94c6221dff Fix edf9f597ec: Screenshot with non-wallclock date saved with wrong filename. (#13721) 2025-03-03 21:44:48 +00:00
glx22 d6a261439b Add: [Script] Framework for loading/saving selected ScriptObject 2025-03-02 13:41:12 +01:00
Peter Nelson edf9f597ec Codechange: Use parameterised GetString() for remaining windows. 2025-03-02 07:29:25 +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
Peter Nelson 3cf9b15959 Codechange: Handle SnowTile state separately from ClearGround.
This removes the need for ClearGround to pretend that CLEAR_SNOW exists.
2025-02-25 08:22:46 +00:00
Rubidium 02f040b22a Codechange: remove unused alloc_func.hpp includes 2025-02-24 20:00:19 +01:00
Rubidium 24a7cde9cc Codechange: explicitly initialise Company member variables 2025-02-22 16:33:05 +01:00
Rubidium 37d549d395 Codefix 35e58f68e4: afterload did not properly set airport rotation 2025-02-18 23:09:02 +01:00
Rubidium fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Rubidium 59df0ff496 Codechange: strongly type StationID 2025-02-16 18:25:51 +01: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 7e04651220 Codechange: strongly type EngineID 2025-02-16 14:50:15 +01:00
Rubidium 2cb59b1856 Codechange: make VehicleID 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 1ffc950e22 Codechange: use prefix operator++ for CompanyID iterations 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 e7595c6c85 Codechange: pass oldloader LoadgameState by reference instead of pointer 2025-02-16 12:31:14 +01:00
Peter Nelson 2d7d085e8e Codechange: Use EncodedString for error messages. (#13569) 2025-02-16 10:04:32 +00:00
Rubidium 4fe3f0ccdd Codechange: simplify management of temporary Engine in saveload 2025-02-14 18:35:12 +01:00
Peter Nelson 6cf7a899e9 Codechange: Use EnumBitSet for PauseMode. (#13553) 2025-02-14 08:30:04 +00:00
Peter Nelson f309b90a1d Codechange: Use EnumBitSet for Airport blocks. 2025-02-13 22:02:02 +00:00
Peter Nelson f0777737af Fix #13459, Fix #13546: Crash when changing NewGRFs in game with picker window open. 2025-02-13 21:07:37 +00:00
Peter Nelson 75387b9e2b Codechange: Use EnumBitSet for StationFacility. 2025-02-13 18:03:13 +00:00
Jonathan G Rennison d06b371254 Cleanup: Fix various spelling errors 2025-02-12 22:44:51 +01:00
Rubidium 37c215f1fd Fix #13513, ec492cb267: std::numeric_limits<CompanyMask> not working causes no vehicles to exist
std::numeric_limits<T>::max() returns 0 instead of an error when the type is unknown.
Solve it by implementing and using Set() and All() in BaseBitSet in same way as std::bitset.
2025-02-09 22:50:55 +01:00
Tyler Trahan 521b860394 Feature: Prevent towns from upgrading individually-placed houses (#13270) 2025-02-09 20:37:06 +00:00
Peter Nelson 1ed685b5c1 Codechange: Use EnumBitSet.Any(). (#13512) 2025-02-09 20:16:16 +00:00
Patric Stout 86841ba1f0 Codechange: no longer add "src" to the include-path (#13511) 2025-02-09 19:43:15 +00:00
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 cd4482b5df Codechange: make TownID 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 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 9ab36b594d Codechange: strongly type OrderID and OrderListID 2025-02-09 15:07:29 +01:00
Rubidium cb3db3cedd Codechange: strongly type ObjectID 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
Peter Nelson dccc6185b9 Codechange: Change internal format of encoded strings to improve robustness and allow expansion. (#13499) 2025-02-09 12:45:50 +00:00