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.
|
|
|
|
Co-Authored-By: Patric Stout <truebrain@openttd.org>
|
|
|
|
|
|
"unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values
|
|
instead of showing the "savegame corrupted" message
|
|
|
|
checking savegames (empty for now).
|
|
|
|
In the first phase, indexes are stored. In the second phase, indexes are checked for validity and converted to pointers
|
|
|