DGDS: Fix reading per-scene globals

The functions that were passed to the constructor would not be called
in the order that they appear, causing the globals list to be initialized
incorrectly
This commit is contained in:
Filippos Karapetis 2024-07-06 17:36:51 +03:00
parent 5ddc825c2c
commit 8459c6f277

View File

@ -1647,8 +1647,11 @@ void GDSScene::initIconSizes() {
bool GDSScene::readPerSceneGlobals(Common::SeekableReadStream *s) {
uint16 numGlobals = s->readUint16LE();
uint16 num, scene;
for (uint16 i = 0; i < numGlobals; i++) {
_perSceneGlobals.push_back(PerSceneGlobal(s->readUint16LE(), s->readUint16LE()));
num = s->readUint16LE();
scene = s->readUint16LE();
_perSceneGlobals.push_back(PerSceneGlobal(num, scene));
_perSceneGlobals.back()._val = s->readSint16LE();
}
return !s->err();