diff options
author | Sven Hesse | 2011-02-04 15:54:52 +0000 |
---|---|---|
committer | Sven Hesse | 2011-02-04 15:54:52 +0000 |
commit | 0efcd484ea1cbd3ec5d3e1f26d3f0f7b9b63e6c6 (patch) | |
tree | f01461848563462778b2d91edfc64f88907efe0f | |
parent | 6a99b6f34044594e511dd8223c777e9c1c06d1cd (diff) | |
download | scummvm-rg350-0efcd484ea1cbd3ec5d3e1f26d3f0f7b9b63e6c6.tar.gz scummvm-rg350-0efcd484ea1cbd3ec5d3e1f26d3f0f7b9b63e6c6.tar.bz2 scummvm-rg350-0efcd484ea1cbd3ec5d3e1f26d3f0f7b9b63e6c6.zip |
GOB: Implement case -2 for oPlaytoons_getObjAnimSize
svn-id: r55768
-rw-r--r-- | engines/gob/inter_playtoons.cpp | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp index e262998e22..1d68a27f57 100644 --- a/engines/gob/inter_playtoons.cpp +++ b/engines/gob/inter_playtoons.cpp @@ -316,20 +316,54 @@ void Inter_Playtoons::oPlaytoons_readData(OpFuncParams ¶ms) { void Inter_Playtoons::oPlaytoons_getObjAnimSize() { int16 objIndex; uint16 readVar[4]; - uint8 i; + uint16 types[4]; Mult::Mult_AnimData animData; _vm->_game->_script->evalExpr(&objIndex); - for (i = 0; i < 4; i++) - readVar[i] = _vm->_game->_script->readVarIndex(); + for (int i = 0; i < 4; i++) + readVar[i] = _vm->_game->_script->readVarIndex(0, &types[0]); if (objIndex == -1) { warning("oPlaytoons_getObjAnimSize case -1 not implemented"); return; } + if (objIndex == -2) { - warning("oPlaytoons_getObjAnimSize case -2 not implemented"); + bool doBreak = false; + for (int i = 0; i < 3; i++) + storeValue(readVar[i], types[i], -1); + + for (int i = readValue(readVar[3], types[3]); i < _vm->_mult->_objCount; i++) { + if (_vm->_mult->_objects[i].pAnimData->isStatic != 0) + continue; + + byte *data = (byte *)_vm->_mult->_objects[i].pAnimData; + + for (int j = 1; j < 39; j += 2) { + int32 value1 = READ_VARO_UINT32(readVar[3] + j * 4); + int32 value2 = READ_VARO_UINT32(readVar[3] + (j + 1) * 4); + if (value1 == -1) { + doBreak = true; + break; + } + + if (value1 >= 0) { + if ((int8)data[value1] != value2) + break; + } else { + if ((int8)data[-value1] == value2) + break; + } + + } + + if (doBreak) { + storeValue(readVar[0], types[0], i); + break; + } + } + return; } |