Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
When a header is added, the chunk changes from CH_ARRAY type to
CH_TABLE type.
|
|
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.
|
|
This adds two byte extra to those chunks, and might feel a bit
silly at first. But in later changes we will prefix CH_ARRAY with
a table header, and then this change shines.
Without this, we could still add headers to these chunks, but any
external reader wouldn't know if the CH_RIFF has them or not. This
way is much more practical, as they are now more like any other
chunk.
|
|
This means that during loading we can validate that what is saved
is also that what is expected. Additionally, this makes all list
types similar to how they are stored on disk:
First a gamma to indicate length, followed by the data.
The size still depends on the type.
|
|
Co-Authored-By: Patric Stout <truebrain@openttd.org>
|
|
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.
|
|
|
|
The only port that ever used it to make heap allocations instead of stack ones was the NDS port, which got thrown out some time ago.
|
|
|
|
|
|
(This was mostly achieved with a few in-place regexes)
|
|
|
|
better alignable
|
|
|
|
"unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values
|
|
IsSavegameVersionBefore().
|
|
some headers
|
|
|
|
checking savegames (empty for now).
|
|
consisted of unrelated values use static const (u)int
|
|
|
|
In the first phase, indexes are stored. In the second phase, indexes are checked for validity and converted to pointers
|
|
|
|
|
|
|