diff options
author | Arnaud Boutonné | 2009-09-04 20:50:16 +0000 |
---|---|---|
committer | Arnaud Boutonné | 2009-09-04 20:50:16 +0000 |
commit | 88bde05828a944e243713ee3eecf4258981e8cb0 (patch) | |
tree | 592297cef5148038884530e32222ad20805ff250 | |
parent | 340c9481333cbe3be7d0e6a6ab6a61cf53708e12 (diff) | |
download | scummvm-rg350-88bde05828a944e243713ee3eecf4258981e8cb0.tar.gz scummvm-rg350-88bde05828a944e243713ee3eecf4258981e8cb0.tar.bz2 scummvm-rg350-88bde05828a944e243713ee3eecf4258981e8cb0.zip |
Add oPlaytoons_getObjAnimSize. It's uncomplete, but it allows to use some functionalities of the construction mode
svn-id: r43948
-rw-r--r-- | engines/gob/inter.h | 2 | ||||
-rw-r--r-- | engines/gob/inter_playtoons.cpp | 46 |
2 files changed, 48 insertions, 0 deletions
diff --git a/engines/gob/inter.h b/engines/gob/inter.h index 2817c0d5d1..80676ee501 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -561,6 +561,8 @@ protected: bool oPlaytoons_freeSprite(OpFuncParams ¶ms); bool oPlaytoons_checkData(OpFuncParams ¶ms); bool oPlaytoons_readData(OpFuncParams ¶ms); + + void oPlaytoons_getObjAnimSize(); void oPlaytoons_CD_20_23(); void oPlaytoons_CD_25(); void oPlaytoons_copyFile(); diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp index 121e194aa4..2b4909544b 100644 --- a/engines/gob/inter_playtoons.cpp +++ b/engines/gob/inter_playtoons.cpp @@ -38,6 +38,7 @@ #include "gob/script.h" #include "gob/hotspots.h" #include "gob/palanim.h" +#include "gob/scenery.h" #include "gob/video.h" #include "gob/videoplayer.h" #include "gob/save/saveload.h" @@ -71,6 +72,7 @@ void Inter_Playtoons::setupOpcodesDraw() { CLEAROPCODEDRAW(0x22); CLEAROPCODEDRAW(0x24); + OPCODEDRAW(0x19, oPlaytoons_getObjAnimSize); OPCODEDRAW(0x20, oPlaytoons_CD_20_23); OPCODEDRAW(0x23, oPlaytoons_CD_20_23); OPCODEDRAW(0x25, oPlaytoons_CD_25); @@ -261,6 +263,50 @@ bool Inter_Playtoons::oPlaytoons_readData(OpFuncParams ¶ms) { return false; } +void Inter_Playtoons::oPlaytoons_getObjAnimSize() { + int16 objIndex; + uint16 readVar[4]; + uint8 i; + bool break_fl; + Mult::Mult_AnimData animData; + + _vm->_game->_script->evalExpr(&objIndex); + + for (i = 0; i < 4; i++) + readVar[i] = _vm->_game->_script->readVarIndex(); + + if (objIndex == -1) { + warning("oPlaytoons_getObjAnimSize case -1 not implemented"); + return; + } + if (objIndex == -2) { + break_fl = false; + warning("oPlaytoons_getObjAnimSize case -2 not implemented"); + return; + } + if ((objIndex < 0) || (objIndex >= _vm->_mult->_objCount)) { + warning("oPlaytoons_getObjAnimSize(): objIndex = %d (%d)", objIndex, _vm->_mult->_objCount); + _vm->_scenery->_toRedrawLeft = 0; + _vm->_scenery->_toRedrawTop = 0; + _vm->_scenery->_toRedrawRight = 0; + _vm->_scenery->_toRedrawBottom = 0; + } else { + animData = *(_vm->_mult->_objects[objIndex].pAnimData); + if (animData.isStatic == 0) + _vm->_scenery->updateAnim(animData.layer, animData.frame, + animData.animation, 0, *(_vm->_mult->_objects[objIndex].pPosX), + *(_vm->_mult->_objects[objIndex].pPosY), 0); + + _vm->_scenery->_toRedrawLeft = MAX<int16>(_vm->_scenery->_toRedrawLeft, 0); + _vm->_scenery->_toRedrawTop = MAX<int16>(_vm->_scenery->_toRedrawTop , 0); + } + + WRITE_VAR_OFFSET(readVar[0], _vm->_scenery->_toRedrawLeft); + WRITE_VAR_OFFSET(readVar[1], _vm->_scenery->_toRedrawTop); + WRITE_VAR_OFFSET(readVar[2], _vm->_scenery->_toRedrawRight); + WRITE_VAR_OFFSET(readVar[3], _vm->_scenery->_toRedrawBottom); +} + void Inter_Playtoons::oPlaytoons_CD_20_23() { _vm->_game->_script->evalExpr(0); } |