diff options
author | Florian Kagerer | 2008-03-17 23:32:26 +0000 |
---|---|---|
committer | Florian Kagerer | 2008-03-17 23:32:26 +0000 |
commit | 760b44da10fa1060612c9dbdc43821efa56a35b5 (patch) | |
tree | 1e1a64aa33919f6e49491dc49a5c880102b9f997 | |
parent | a917a88504dba04bed0022740e283b9eb8b94ebb (diff) | |
download | scummvm-rg350-760b44da10fa1060612c9dbdc43821efa56a35b5.tar.gz scummvm-rg350-760b44da10fa1060612c9dbdc43821efa56a35b5.tar.bz2 scummvm-rg350-760b44da10fa1060612c9dbdc43821efa56a35b5.zip |
- implement opcode 29: o2_drawShape
svn-id: r31170
-rw-r--r-- | engines/kyra/kyra_v2.h | 2 | ||||
-rw-r--r-- | engines/kyra/script_v2.cpp | 31 |
2 files changed, 31 insertions, 2 deletions
diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 559cd038bf..7cccea0852 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -466,6 +466,7 @@ protected: void refreshAnimObjectsIfNeed(); void updateItemAnimations(); + void flagAnimObjUnk8(); void flagAnimObjsForRefresh(); void updateCharFacing(); @@ -972,6 +973,7 @@ protected: int o2_wsaOpen(ScriptState *script); int o2_displayWsaSequentialFrames(ScriptState *script); int o2_displayWsaSequence(ScriptState *script); + int o2_drawShape(ScriptState *script); int o2_addItemToCurScene(ScriptState *script); int o2_checkForItem(ScriptState *script); int o2_removeItemSlotFromInventory(ScriptState *script); diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index 9a2e94fa73..6a9480058a 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -355,6 +355,33 @@ int KyraEngine_v2::o2_displayWsaSequence(ScriptState *script) { return 0; } +int KyraEngine_v2::o2_drawShape(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); + + uint8 *shp = getShapePtr(stackPos(0) + 64); + int x = stackPos(1); + int y = stackPos(2); + uint8 dsFlag = stackPos(3) & 0xff; + uint8 modeFlag = stackPos(4) & 0xff; + + if (modeFlag) { + _screen->drawShape(2, shp, x, y, 2, dsFlag ? 1 : 0); + } else { + _screen->hideMouse(); + restorePage3(); + _screen->drawShape(2, shp, x, y, 2, dsFlag ? 1 : 0); + memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080); + _screen->drawShape(0, shp, x, y, 2, dsFlag ? 1 : 0); + + flagAnimObjsForRefresh(); + flagAnimObjUnk8(); + refreshAnimObjectsIfNeed(); + _screen->showMouse(); + } + + return 0; +} + int KyraEngine_v2::o2_addItemToCurScene(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addItemToCurScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); const int16 id = stackPos(0); @@ -543,7 +570,7 @@ int KyraEngine_v2::o2_drawSceneShape(ScriptState *script) { _screen->drawShape(0, _sceneShapeTable[shape], x, y, 2, flag); - //sub_B521(); + flagAnimObjUnk8(); flagAnimObjsForRefresh(); refreshAnimObjectsIfNeed(); _screen->showMouse(); @@ -1468,7 +1495,7 @@ void KyraEngine_v2::setupOpcodeTable() { Opcode(o2_displayWsaSequence), // 0x1c OpcodeUnImpl(), - OpcodeUnImpl(), + Opcode(o2_drawShape), Opcode(o2_addItemToCurScene), OpcodeUnImpl(), // 0x20 |