summaryrefslogtreecommitdiff
path: root/src/saveload/town_sl.cpp
AgeCommit message (Collapse)Author
2021-07-06Codechange: Use a common sub-class for NewGRFMapping chunksglx22
2021-07-06Cleanup: Remove now unneeded ChunkHandler membersglx22
2021-07-06Codechange: Use ChunkHandlers sub-classesglx22
2021-07-06Codechange: Use static array of references to ChunkHandlerglx22
2021-07-02Add: store headers for chunks with SL_STRUCTLISTPatric Stout
2021-07-02Add: store headers for most savegame chunksPatric Stout
When a header is added, the chunk changes from CH_ARRAY type to CH_TABLE type.
2021-07-02Feature: framework to make savegames self-descriptivePatric Stout
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-06-15Change: store length of SL_STRUCTLIST in the savegamePatric Stout
This wasn't consistently done, and often variables were used that were read by an earlier blob. By moving it next to the struct itself, the code becomes a bit more self-contained and easier to read. Additionally, this allows for external tooling to know how many structs to expect, instead of having to know where to find the length-field or a hard-coded value that can change at any moment.
2021-06-14Codechange: use SLE_STRUCT(LIST) for Town chunksPatric Stout
2021-06-10Codechange: rename SL_LST to SL_REFLIST to highlight the "reference" partPatric Stout
You can easily mistake SlList / SL_LST to be a list of SL_VAR, but it is a list of SL_REF. With this rename, it hopefully saves a few people from "wtf?" moments.
2021-06-06Codechange: Remove FOR_ALL_CHUNK_HANDLERSglx22
Co-Authored-By: Patric Stout <truebrain@openttd.org>
2021-05-31Codechange: C++-ify lists for SaveLoad (#9323)Patric Stout
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.
2020-07-27Codechange #8258: Remove unused town cargo caches from the savegamedP
2020-06-28Change #8159: Remove now unused town cargo caches without bumping the ↵dP
savegame version
2020-06-28Revert #8157: Redundant changedP
2020-06-28Fix: Incorrect save/load array size of Town::cargo_acceptedJonathan G Rennison
In 11ab3c4e the number of cargo types was changed from 32 to 64. The save/load of Town::cargo_accepted was not updated, such that only half of the data structure is saved/loaded in savegame versions 199 to 218. Discard and regenerate data from all savegame versions prior to 219.
2020-05-21Codechange: Use std::string for most of the user-settable custom names.Michael Lutz
2019-12-21Codechange: Replace FOR_ALL_TOWNS with range-based for loopsglx
2019-11-10Cleanup: Removed SVN headersS. D. Cloudt
2019-04-13Cleanup: Fix alignment after NULL -> nullptr change.peter1138
2019-04-10Codechange: Use null pointer literal instead of the NULL macroHenry Wilson
2019-03-09Codechange: Make a k-d tree index of townsNiels Martin Hansen
2019-02-02Codechange: Change from numeric to descriptive SLV enum labels for last entries.Peter Nelson
2019-02-02Codechange: Convert saveload numbers to enum values.Peter Nelson
(This was mostly achieved with a few in-place regexes)
2019-02-02Codechange: Make saveload version upper bound exclusive, i.e. version object ↵Peter Nelson
was removed instead of version object last appeared.
2018-06-26Change: Increase cargo type limit to 64.PeterN
2018-05-21Change: Add CargoTypes type for cargo masks. (#6790)PeterN
2017-02-26(svn r27756) -Codechange: Add StringTab enumfrosch
2017-02-26(svn r27754) -Codechange: Add GetStringTab(), GetStringIndex() and ↵frosch
MakeStringID() to access the structure of StringIDs.
2014-04-23(svn r26482) -Codechange: add an include that allows us to undefine/redefine ↵rubidium
"unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values
2013-01-08(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by ↵planetmaker
Eagle_rainbow)
2012-08-18(svn r24482) -Fix [FS#5232] (r24180): Do not call ↵frosch
RebuildSubsidisedSourceAndDestinationCache() before subsidy savegame conversion is finished.
2012-04-26(svn r24182) -Fix [FS#5169-ish]: The population of a town was computed ↵frosch
incorrectly for overridden houses when loading a game.
2012-04-25(svn r24180) -Codechange/feature-ish: add cache checker for the town's cacherubidium
2012-04-25(svn r24179) -Codechange: move some variables of Town to TownCacherubidium
2011-12-22(svn r23657) -Fix (r22958): loading of very old savegames with custom town ↵yexo
names failed
2011-12-19(svn r23636) -Add: introduce ScriptText in parameters where it can be usedtruebrain
2011-12-19(svn r23626) -Add: ScriptTown::SetText, which adds custom text to the Town GUItruebrain
2011-12-15(svn r23526) -Codechange: unify cargos vs cargoesrubidium
2011-12-04(svn r23418) -Fix [FS#4866] (r22958): saves made with the Catalan town name ↵rubidium
generator would trigger a "savegame corrupt" exception
2011-12-03(svn r23407) -Codechange: Keep a bitmap of all cargos accepted by towns.terkhen
2011-12-03(svn r23405) -Codechange: Keep a matrix of cargos accepted by houses for ↵terkhen
each town (michi_cc).
2011-11-23(svn r23300) -Add: show on the GUI when a town grows and make a general ↵truebrain
framework to store goals of a town
2011-11-23(svn r23298) -Add: track statistics of all incoming and outgoing goods. ↵truebrain
Incoming based on TownEffect, outgoing based on CargoType (based on patch by Terkhen)
2011-11-15(svn r23233) -Codechange: Refactor maximum and actually transported cargo ↵michi_cc
amount of towns into a reusable struct.
2011-09-23(svn r22958) -Fix [FS#4778]: the savegame description and loading of ↵rubidium
savegames would crash with savegames from a patched stable (which didn't bump the savegame version)
2011-09-11(svn r22920) -Cleanup: replace two very old town variables taht were rarely ↵yexo
used by small functions that compute there value on-the-fly when necessary
2011-06-12(svn r22568) -Change: Add a list of persistent storages to the Town class.terkhen
2010-08-24(svn r20610) -Fix (r20609): X and Y got swapped.frosch
2010-08-24(svn r20609) -Fix [FS#3702]: crash when a NewGRF defined an invalid ↵yexo
substitute type for a house and the NewGRF was removed during the game