Change: make as many savegame chunks a CH_ARRAY as possible #9375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Problem
Weird goal, I know right? But hear me out.
#9322 sets out to make to make our savegame self-descriptive (see motivation for that there). But in order to do that, we need to make all chunks a table.
The first step in making anything a table, is to first make it an array. And so we come to the motivation of this PR: to make that possible.
Description
Most
CH_RIFF
s in fact are just an array of length 1. So it might seem silly at first, but that is exactly what this PR does: make those chunks into an array of length 1.The exception was the
GLOG
chunk. That required some more love and attention.After this PR, only the map-chunks are
CH_RIFF
. Those could be made intoCH_ARRAY
, but that is not really useful, as they cannot become self-describing for now anyway.Lastly, the chunk table tells how chunks are stored on disk. Chunks that are no longer stored were still marked by their old type. This was often confusing. So I sneaked that change in here, to mark those as
CH_READONLY
, making it more clear that it is not by accident.Limitations
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.