Saveload: Add helper to skip chunk contents

This commit is contained in:
Jonathan G Rennison 2024-07-07 15:34:09 +01:00
parent 0dc4be2aa0
commit 61f920138f
2 changed files with 13 additions and 0 deletions

View File

@ -2332,6 +2332,17 @@ void SlLoadTableWithArrayLengthPrefixesMissing()
SetBit(_sl.block_flags, SLBF_TABLE_ARRAY_LENGTH_PREFIX_MISSING); SetBit(_sl.block_flags, SLBF_TABLE_ARRAY_LENGTH_PREFIX_MISSING);
} }
void SlSkipChunkContents()
{
if (SlIsTableChunk()) SlSkipTableHeader();
if (_sl.block_mode == CH_RIFF) {
SlSkipBytes(SlGetFieldLength());
} else {
SlSkipArray();
}
}
/** /**
* Save or Load (a list of) global variables. * Save or Load (a list of) global variables.
* @param slt The SaveLoad table with objects to save/load. * @param slt The SaveLoad table with objects to save/load.

View File

@ -1079,6 +1079,8 @@ void SlSaveTableObjectChunk(const SaveLoadTable &slt);
void SlLoadTableOrRiffFiltered(const SaveLoadTable &slt); void SlLoadTableOrRiffFiltered(const SaveLoadTable &slt);
void SlLoadTableWithArrayLengthPrefixesMissing(); void SlLoadTableWithArrayLengthPrefixesMissing();
void SlSkipChunkContents();
inline void SlSaveTableObjectChunk(const NamedSaveLoadTable &slt) inline void SlSaveTableObjectChunk(const NamedSaveLoadTable &slt)
{ {
SlSaveTableObjectChunk(SlTableHeader(slt)); SlSaveTableObjectChunk(SlTableHeader(slt));