GOB: Fix TOT text resources loading when no sprite resources are present

This fixes the missing text in Bargon Attack/Atari intro scene.
This commit is contained in:
Simon Delamarre 2023-11-21 12:51:18 +01:00
parent 8983b1c791
commit 6c3d960a90

View File

@ -240,11 +240,7 @@ bool Resources::loadTOTResourceTable() {
_totResStart = totProps.scriptEnd;
if ((totProps.resourcesOffset == 0xFFFFFFFF) ||
(totProps.resourcesOffset == 0))
// No resources here
return false;
if (totProps.resourcesOffset != 0xFFFFFFFF && totProps.resourcesOffset != 0) {
_totResourceTable = new TOTResourceTable;
stream->seek(totProps.resourcesOffset);
@ -277,6 +273,11 @@ bool Resources::loadTOTResourceTable() {
} else
item.type = kResourceTOT;
}
} else {
_totResourceTable = nullptr;
// Do not return yet: although there is no *sprite* resource table,
// a text table may still be present.
}
_totSize = stream->size() - _totResStart;