diff options
author | Borja Lorente | 2016-06-30 08:41:25 +0200 |
---|---|---|
committer | Borja Lorente | 2016-08-14 18:43:13 +0200 |
commit | 517aceefcb397ccda476dc7e2b02d6da5595e4fd (patch) | |
tree | e0430870cb341ba64f903d3042bffecfc744ea19 /engines/macventure/world.cpp | |
parent | 246fec28f55ca646a77985cd7b95a33b2cae994d (diff) | |
download | scummvm-rg350-517aceefcb397ccda476dc7e2b02d6da5595e4fd.tar.gz scummvm-rg350-517aceefcb397ccda476dc7e2b02d6da5595e4fd.tar.bz2 scummvm-rg350-517aceefcb397ccda476dc7e2b02d6da5595e4fd.zip |
MACVENTURE: Add scene transition
Diffstat (limited to 'engines/macventure/world.cpp')
-rw-r--r-- | engines/macventure/world.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/macventure/world.cpp b/engines/macventure/world.cpp index 8e83f91057..670f39902c 100644 --- a/engines/macventure/world.cpp +++ b/engines/macventure/world.cpp @@ -43,17 +43,23 @@ World::~World() { uint32 World::getObjAttr(ObjID objID, uint32 attrID) { uint32 res; uint32 index = _engine->getGlobalSettings().attrIndices[attrID]; + // HACK, but if I try to initialize it in the else clause, it goes out of scope and segfaults + Common::SeekableReadStream *objStream = _objectConstants->getItem(objID); if (!(index & 0x80)) { // It's not a constant res = _saveGame->getAttr(objID, index); } else { - Common::SeekableReadStream *objStream = _objectConstants->getItem(objID); index &= 0x7F; - objStream->skip((index * 2) - 1); - res = objStream->readUint16BE(); + if (objStream->size() == 0) return 0; + // Look for the right attribute inside the object + objStream->skip(index * 2); + res = objStream->readByte() << 8; + res |= objStream->readByte(); } res &= _engine->getGlobalSettings().attrMasks[attrID]; res >>= _engine->getGlobalSettings().attrShifts[attrID]; - debug(11, "Attribute %x from object %x is %x", attrID, objID, res); + if (res & 0x8000) + res = -((res ^ 0xffff) + 1); + debug(3, "Attribute %x from object %x is %x", attrID, objID, res); return res; } |