summaryrefslogtreecommitdiff
path: root/src/saveload/company_sl.cpp
AgeCommit message (Collapse)Author
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-02Codechange: make savegame-version checks more obvious in SlCompanyLiveries::LoadPatric Stout
num_liveries indirectly contained the same information, but this makes reading these things pretty difficult. So use IsSavegameVersionBefore() like everywhere else instead.
2021-07-02Add: store headers for chunks with SL_STRUCTLISTPatric Stout
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 Company chunksPatric Stout
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.
2021-05-03Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loopsglx22
2021-01-08Codechange: Remove min/max functions in favour of STL variants (#8502)Charles Pigott
2020-05-21Codechange: Use std::string for most of the user-settable custom names.Michael Lutz
2019-12-21Codechange: Replace station related FOR_ALL with range-based for loopsglx
2019-12-21Codechange: Replace FOR_ALL_COMPANIES with range-based for loopsglx
2019-11-10Cleanup: Removed SVN headersS. D. Cloudt
2019-05-01Feature: Add NotRoadTypes (NRT)peter1138
2019-04-10Codechange: Use null pointer literal instead of the NULL macroHenry Wilson
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.
2019-01-31Feature: Group liveries, and livery window usability enhancements. (#7108)PeterN
* Change: Replace checkbox in livery selection window with Default option in drop down selection. This reduces clutter in the UI and allows for primary/secondary colours to independently follow the default scheme if desired. * Feature: Add vehicle group liveries.
2018-06-27Codechange: Silence -Wclass-memaccess warnings with GCC8Charles Pigott
2018-06-26Change: Increase cargo type limit to 64.PeterN
2018-05-19Change: Available railtypes is always calculated on load, so no need to load ↵PeterN
value for old savegames (#6782)
2017-08-13(svn r27893) -Codechange: Use fallthrough attribute. (LordAro)frosch
2017-02-26(svn r27757) -Change: Make StringID 32bit.frosch
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-05-16(svn r26590) -Fix: possible desync (big/little endian) due to not writing ↵rubidium
complete variables upon saveload
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
2012-10-20(svn r24619) -Change: Check for bankruptcy on a monthly basis (ZxBioHazardZx)planetmaker
2012-04-17(svn r24134) -Add: Configurable limits for tree planting.michi_cc
2012-02-09(svn r23920) -Fix: Consider only the middle tile of a lock for ↵frosch
lock-infrastructure costs. The other two tiles may be owned by other companies. Also do not count the middle tile of a lock as canal, independent of whether it is build on ground or river slope.
2012-01-22(svn r23844) -Fix (r23414): Infrastructure count for stations wasn't updated ↵michi_cc
properly on company takeover. And don't count buoys while loading a game either.
2012-01-20(svn r23826) -Fix [FS#4972]: the detailed performance rating window showed ↵rubidium
the cargo count of the current quarter instead of the last quarter like the tooltip says
2012-01-03(svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp filesrubidium
2011-12-19(svn r23636) -Add: introduce ScriptText in parameters where it can be usedtruebrain
2011-12-03(svn r23414) -Add: Company infrastructure counts for stations/airports.michi_cc
2011-12-03(svn r23413) -Add: Company infrastructure counts for canals.michi_cc
2011-12-03(svn r23412) -Add: Company infrastructure counts for road.michi_cc
2011-12-03(svn r23411) -Add: Company infrastructure counts for rail.michi_cc
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-08-12(svn r22737) -Fix [FS#4717]: some corrupted savegames could crash OpenTTD ↵rubidium
instead of showing the "savegame corrupted" message
2011-01-04(svn r21728) -Fix/Feature [FS#4331]: (configurably) limit amount of tiles ↵rubidium
that can be cleared/terraformed by a company
2010-11-21(svn r21284) -Codechange: Rename CheckSavegameVersion() to ↵alberth
IsSavegameVersionBefore().
2010-08-26(svn r20632) -Cleanup: remove "a few" unneeded includes, and add them to ↵rubidium
some headers
2010-08-02(svn r20311) -Codechange: don't reserve extra space in the savegame that is ↵yexo
never used
2010-06-13(svn r19985) -Fix (r19980): Loading preview data from old savegames failed ↵frosch
indeterministically due to non-zeroed memory allocation. Thanks smatz.
2010-06-13(svn r19980) -Add: Load some general data from savegames on SL_LOAD_CHECK.frosch