Commit Graph

29 Commits

Author SHA1 Message Date
rubidium42 0833396cdf Codechange: use proper names for SLV_115 - SLV_144 (#15766)
* Codechange: rename SLV_115 to SLV_CUSTOM_TOWN_NUMBER
* Codechange: rename SLV_116 to SLV_GAMELOG_EMERGENCY
* Codechange: rename SLV_117 to SLV_PLATFORM_STOP_LOCATION
* Codechange: rename SLV_118 to SLV_DIGIT_GROUP_SEPARATOR
* Codechange: rename SLV_119 to SLV_PAUSE_MODES
* Codechange: rename SLV_120 to SLV_COMPANY_SERVICE_INTERVALS
* Codechange: rename SLV_121 to SLV_CARGO_PAYMENTS
* Codechange: rename SLV_122 to SLV_WAYPOINT_MORE_LIKE_STATION
* Codechange: rename SLV_123 to SLV_UNIFY_WAYPOINT_AND_STATION
* Codechange: rename SLV_124 to SLV_MULTI_TILE_WAYPOINTS
* Codechange: rename SLV_125 to SLV_REMOVE_SUBSIDY_STATION_BINDING
* Codechange: rename SLV_126 to SLV_CUMULATED_INFLATION
* Codechange: rename SLV_127 to SLV_TOWN_ACCEPTANCE
* Codechange: rename SLV_128 to SLV_FOUND_TOWN
* Codechange: rename SLV_129 to SLV_TIMETABLE_START
* Codechange: rename SLV_130 to SLV_ROAD_STOP_OCCUPANCY_PENALTY
* Codechange: rename SLV_131 to SLV_MAXIMUM_DEPOT_PENALTY
* Codechange: rename SLV_132 to SLV_DISALLOW_TREE_BUILDING
* Codechange: rename SLV_133 to SLV_TRAIN_SLOPE_STEEPNESS
* Codechange: rename SLV_134 to SLV_VIRTUAL_FEEDER_SHARE_PAYMENT
* Codechange: rename SLV_135 to SLV_ROCKS_STAY_UNDER_SNOW
* Codechange: rename SLV_136 to SLV_SPLIT_LOAD_WAIT_COUNTERS
* Codechange: rename SLV_137 to SLV_AIRPORT_ANIMATION_FRAMES
* Codechange: rename SLV_138 to SLV_REDUCE_PLANE_CRASHES
* Codechange: rename SLV_139 to SLV_RV_REALISTIC_ACCELERATION
* Codechange: rename SLV_140 to SLV_STORE_AIRPORT_SIZE
* Codechange: rename SLV_141 to SLV_UNIQUE_DEPOT_NAMES
* Codechange: rename SLV_142 to SLV_NEWGRF_DEPOT_BUILD_DATE
* Codechange: rename SLV_143 to SLV_DISABLE_TOWN_LEVEL_CROSSING
* Codechange: rename SLV_144 to SLV_REORDER_UNMOVABLE_REMOVE_RESERVED
2026-06-23 23:17:14 +02:00
rubidium42 d81eefcdc8 Codechange: use proper names for SLV_1 - SLV_19 (#15750)
* Codechange: rename SLV_1 to SLV_BIG_CURRENCY
* Codechange: rename SLV_2 to SLV_VEHICLE_CURRENCY_STATION_CHANGES
* Codechange: rename SLV_3 to SLV_BIGGER_STATION_VARIABLES
* Codechange: rename SLV_4 to SLV_TOWN_TOLERANCE_PAUSE_MODE
* Codechange: rename SLV_5 to SLV_BIG_MAP
* Codechange: rename SLV_6 to SLV_MULTIPLE_ROAD_STOPS
* Codechange: rename SLV_7 to SLV_LARGER_CARGO_SOURCE
* Codechange: rename SLV_8 to SLV_LARGER_UNIT_NUMBER
* Codechange: rename SLV_9 to SLV_LARGER_TOWN_CARGO_STATISTICS
* Codechange: rename SLV_10 to SLV_LARGER_TOWN_COUNTER
* Codechange: rename SLV_11 to SLV_LARGER_TOWN_ITERATOR
* Codechange: rename SLV_12 to SLV_LINK_WAYPOINT_TO_TOWN
* Codechange: rename SLV_13 to SLV_LARGER_AI_STATE_COUNTER
* Codechange: rename SLV_14 to SLV_TRANSFER_ORDER
* Codechange: rename SLV_15 to SLV_MOVE_SEMAPHORE_BITS
* Codechange: rename SLV_16 to SLV_ENGINE_RENEW
* Codechange: rename SLV_17 to SLV_STORE_WAYPOINT_ID_IN_MAP
* Codechange: rename SLV_18 to SLV_REMOVE_MINOR_VERSION
* Codechange: rename SLV_19 to SLV_ENGINE_RENEW_POOL
2026-06-21 19:27:53 +02:00
Rubidium ee9e8ab9b2 Codechange: replace 'new (index) PoolItem(...' with 'PoolItem::CreateAtIndex(index, ...' 2026-01-03 16:04:32 +01:00
Rito12 859b56a066 Doc: Correct file descriptions to match coding style and doxygen. 2025-12-15 17:31:00 +01:00
Cyprian Klimaszewski 99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +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 1003967267 Codechange: strongly type TownID 2025-02-16 14:50:15 +01:00
glx22 6e627f35ac Cleanup: Remove now unneeded ChunkHandler members 2021-07-06 22:29:08 +02:00
glx22 2c941cd8b3 Codechange: Use ChunkHandlers sub-classes 2021-07-06 22:29:08 +02:00
glx22 c1a9fe6fbd Codechange: Use static array of references to ChunkHandler 2021-07-06 22:29:08 +02:00
Patric Stout cdb3dd0493 Add: store headers for most savegame chunks
When a header is added, the chunk changes from CH_ARRAY type to
CH_TABLE type.
2021-07-02 22:21:58 +02:00
Patric Stout 7dd5fd6ed4 Feature: framework to make savegames self-descriptive
We won't be able to make it fully self-descriptive (looking at you
MAP-chunks), but anything else can. With this framework, we can
add headers for each chunk explaining how each chunk looks like
in detail.

They also will all be tables, making it a lot easier to read in
external tooling, and opening the way to consider a database
(like SQLite) to use as savegame format.

Lastly, with the headers in the savegame, you can freely add
fields without needing a savegame version bump; older versions
of OpenTTD will simply ignore the new field. This also means
we can remove all the SLE_CONDNULL, as they are irrelevant.

The next few commits will start using this framework.
2021-07-02 22:21:58 +02:00
glx22 c27afdf3f6 Codechange: Remove FOR_ALL_CHUNK_HANDLERS
Co-Authored-By: Patric Stout <truebrain@openttd.org>
2021-06-06 19:35:06 +02:00
Patric Stout 9fff00ba20 Codechange: C++-ify lists for SaveLoad (#9323)
Basically, this changes "SaveLoad *" to either:
1) "SaveLoadTable" if a list of SaveLoads was meant
2) "SaveLoad &" if a single entry was meant

As added bonus, this removes SL_END / SLE_END / SLEG_END. This
also adds core/span.hpp, a "std::span"-lite.
2021-05-31 22:26:44 +02:00
Michael Lutz 63ccb36ef3 Codechange: Use std::string for most of the user-settable custom names. 2020-05-21 20:02:34 +02:00
glx fa9769f81a Codechange: Replace FOR_ALL_DEPOTS with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Peter Nelson 9de12521ec Codechange: Convert saveload numbers to enum values.
(This was mostly achieved with a few in-place regexes)
2019-02-02 21:39:06 +00:00
Peter Nelson ea4ea62816 Codechange: Make saveload version upper bound exclusive, i.e. version object was removed instead of version object last appeared. 2019-02-02 21:39:06 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
alberth 3e27739287 (svn r21284) -Codechange: Rename CheckSavegameVersion() to IsSavegameVersionBefore(). 2010-11-21 12:47:04 +00:00
yexo 9cfb61adf5 (svn r20003) -Feature [FS#3886]: [NewGRF] var 43 depot build date for railtypes 2010-06-20 19:13:02 +00:00
frosch 62ac138154 (svn r19973) -Codechange: Add another procedure to chunk handlers for checking savegames (empty for now). 2010-06-13 14:11:59 +00:00
smatz d568a4258b (svn r19806) -Codechange: silence one warning 2010-05-13 05:34:21 +00:00
rubidium 93ff7d78e1 (svn r19799) -Change: give depots an unique name in the same manner buoys and waypoints are named 2010-05-12 19:21:00 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
smatz 570af0ce44 (svn r16338) -Codechange: split loading of references to two phases
In the first phase, indexes are stored. In the second phase, indexes are checked for validity and converted to pointers
2009-05-17 16:28:29 +00:00
smatz 7368c740a6 (svn r14828) -Codechange: move most of save/load-specific code to separate files 2009-01-04 15:32:25 +00:00