summaryrefslogtreecommitdiff
path: root/src/saveload
AgeCommit message (Collapse)Author
2021-06-10Codechange: rework CHTS-chunk save/load to be more like the othersPatric 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-10Codechange: refactor SlList to use SlStorageHelperPatric Stout
2021-06-10Codechange: refactor SlDequeueHelper to work with unsigned and be more genericPatric Stout
Future additions will start using it for std::list too.
2021-06-10Codechange: use wrappers to get Var[Mem|File]Type, instead of GB()Patric Stout
2021-06-10Codechange: move GetVariableAddress inside SlObjectMemberPatric Stout
Also move it to static, as nobody else is using it.
2021-06-08Fix: compatible NewGRFs in crash-log reported wrong md5 (#9340)Patric Stout
The text suggests it reports the original md5, but it does in fact report the replaced md5. Now it reports both.
2021-06-07Codechange: make [Save|Load]Settings() behave more like other Save/Load code ↵Patric Stout
(#9335) Prepare the full description and send it to SlObject. This does require some code to be able to read to a SLE_VAR_NULL, like strings etc, as there is no way to know their length beforehand.
2021-06-06Codechange: merge guiflags and flags in settings .ini filesPatric Stout
It was rather confusing which one was for what, especially as some SaveLoad flags were settings-only. Clean up this mess a bit by having only Setting flags.
2021-06-06Codechange: move SLF_NO_NETWORK_SYNC into settingsPatric Stout
It is a settings-only flag, so don't pollute SaveLoad code with it.
2021-06-06Codechange: move SLF_NOT_IN_SAVE into settingsPatric Stout
It is a settings-only flag, so don't pollute SaveLoad code with it.
2021-06-06Codechange: remove the unused SLF_HEX flagPatric Stout
2021-06-06Codechange: Remove FOR_ALL_CHUNK_HANDLERSglx22
Co-Authored-By: Patric Stout <truebrain@openttd.org>
2021-06-03Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways ↵Patric Stout
we had While at it, replace OTTD_ASSERT with WITH_ASSERT, as this is always set if assert() is valid. No matter if NDEBUG is set or not.
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-30Codechange: add a wrapper function to find all settings based on prefix (#9312)Patric Stout
2021-05-29Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)Patric Stout
This to be more explicit the function changes the value, and not returns yes/no.
2021-05-27Codechange: use initializer_lists for the settings tablesrubidium42
Not using vectors as those require copying from the initializer list and that makes unique_ptrs to the actual SettingDesc objects later impossible.
2021-05-27Codechange: let SettingDesc extend SettingDescBaserubidium42
2021-05-15Change: Use gender-neutral pronounsrubidium42
2021-05-15Fix: empty undocumented branchesrubidium42
2021-05-15Fix: comparison of narrow type to wide type in loop (potential for infinite ↵Rubidium
loops)
2021-05-13Codechange: clean up C-string support from settingsrubidium42
2021-05-13Codechange: move script settings to std::stringrubidium42
2021-05-13Codechange: move misc settings to std::stringrubidium42
2021-05-13Codechange: Replace TILE_AREA_LOOP with range-based for loopsglx22
2021-05-12Change: reworked the debug levels for network facility (#9251)Patric Stout
It now follows very simple rules: 0 - Fatal, user should know about this 1 - Error, but we are recovering 2 - Warning, wrong but okay if you don't know 3 - Info, information you might care about 4 - 5 - Debug #1 - High level debug messages 6 - Debug #2 - Low level debug messages 7 - Trace information
2021-05-12Fix #9202: Invalid test for unset NewGRF override mapping. (#9226)PeterN
2021-05-08Codechange: Don't save unused NewGRF override mappings. (#9202)PeterN
2021-05-08Change: Use gender-neutral pronouns in console command messages (and ↵William Davis
comments) (#9203)
2021-05-03Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loopsglx22
2021-05-02Fix: Update text effect size when font zoom is changed. (#9174)PeterN
2021-04-29Fix: [MinGW] Set minimum OS version to Windows XP (#9135)Loïc Guilloux
2021-04-22Feature: Per-group wagon removal flag.peter1138
2021-04-22Codechange: Replace Group::replace_protection with Group::flagspeter1138
2021-04-17Fix: Corrupted savegame could cause heap corruption by writing outside link ↵Milek7
graph edge matrix. (#9046)
2021-04-17Fix: Corrupted savegame could crash the game by providing invalid gamelog ↵Milek7
enums. (#9045)
2021-03-26Fix: store the recent new game_creation settings in savegamesPatric Stout
This allows us to later on see what someone did, and makes sure that "restart" command still knows how the game was created.
2021-03-26Change: rename setting "max_heightlevel" to "map_height_limit"Patric Stout
This better reflects what it is, and hopefully removes a bit of the confusion people are having what this setting actually does. Additionally, update the text on the setting to better inform users what it is doing exactly, so they can make an educated decision on how to change it. Next commit will introduce an "auto" value, which should be the new default. The rename has as added benefit that everyone will start out on the "auto" value.
2021-03-14Change: Heading for 1.12 now (#8862)Patric Stout
2021-02-28Add: settings to limit your fast-forward game speedPatric Stout
By default this setting is set to 2500% normal game speed.
2021-02-13Codechange: Don't use cpp_offsetof in the save/load code.Michael Lutz
Many of the member variables that are used in save/load are inside types that are not standard layout types. Using pointer arithmetics to determine addresses of members inside types that are not standard layout is generally undefined behaviour. If we'd use C++17, it is conditionally supported, which means each compiler may or may not support it. And even then using it for individual array elements is syntactically not supported the the standard offsetof function. Unfortunately, the trickery employed for saving linkgraph settings causes quite some clutter in the settings ini files.
2021-02-13Codechange: Don't use cpp_offsetof in the TTO/TTD savegame loader.Michael Lutz
Many of the member variables that are used in the oldloader are inside types that are not standard layout types. Using pointer arithmetics to determine addresses of members inside types that are not standard layout is generally undefined behaviour. If we'd use C++17, it is conditionally supported, which means each compiler may or may not support it. And even then using it for individual array elements is syntactically not supported the the standard offsetof function.
2021-01-22Change: Apply some consistency to singleplayer related commentsglx22
2021-01-22Feature: Allow GameScripts to add additional text to Industry view windowdP
2021-01-18Fix #8589, 653e7fa548: Motion counter is NewGRF-visible but not saved, ↵Michael Lutz
leading to desyncs. (#8591)
2021-01-17Fix eeb88e8: Trains reversed while paused do not correctly update sprite ↵Matt Kimber
bounds (#8540)
2021-01-08Fix 2fd871e2af5: load correct ending-year for old (pre 0.7) savegamesPatric Stout
Despite what it looked like, you could never really change the ending-year (it was always reset to 2050 on start-up). See commit 683b65ee1 for details. As a side-effect, the variable that was suppose to store the ending-year was just zero, never containing a real ending-year.
2021-01-08Codechange: Remove min/max functions in favour of STL variants (#8502)Charles Pigott
2021-01-05Codechange: create MutableSpriteCache to remove the need to cast Vehicle to ↵Matt Kimber
a mutable type in render methods