diff options
author | Johannes Schickel | 2007-10-13 18:53:49 +0000 |
---|---|---|
committer | Johannes Schickel | 2007-10-13 18:53:49 +0000 |
commit | 8d678b8705849b405d0180ad960da24d84f3e9aa (patch) | |
tree | cc769fb2ff54b0df219b22923c74d36a1bfee4e6 /engines/kyra | |
parent | 7f7b08b42ee8aa99d121ade8b8055d74c76f5fbc (diff) | |
download | scummvm-rg350-8d678b8705849b405d0180ad960da24d84f3e9aa.tar.gz scummvm-rg350-8d678b8705849b405d0180ad960da24d84f3e9aa.tar.bz2 scummvm-rg350-8d678b8705849b405d0180ad960da24d84f3e9aa.zip |
HoF:
- implemented opcode
-> o2_setCharacterPos 1
svn-id: r29210
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.h | 1 | ||||
-rw-r--r-- | engines/kyra/script_v2.cpp | 16 |
3 files changed, 18 insertions, 1 deletions
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index fa1394ba9c..32fb7c8ad0 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -1466,7 +1466,7 @@ void KyraEngine_v2::setupOpcodeTable() { static const OpcodeV2 opcodeTable[] = { // 0x00 Opcode(o2_setCharacterFacingRefresh), - OpcodeUnImpl(), + Opcode(o2_setCharacterPos), Opcode(o2_defineObject), Opcode(o2_refreshCharacter), // 0x04 diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index a46e0a0960..4b866d7da9 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -545,6 +545,7 @@ protected: // opcodes int o2_setCharacterFacingRefresh(ScriptState *script); + int o2_setCharacterPos(ScriptState *script); int o2_defineObject(ScriptState *script); int o2_refreshCharacter(ScriptState *script); int o2_getCharacterX(ScriptState *script); diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index 4f670956cf..167d9ea329 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -42,6 +42,22 @@ int KyraEngine_v2::o2_setCharacterFacingRefresh(ScriptState *script) { return 0; } +int KyraEngine_v2::o2_setCharacterPos(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "o2_setCharacterFacingRefresh(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2)); + int x = stackPos(1); + int y = stackPos(2); + + if (x != -1 && y != -1) { + x &= ~3; + y &= ~1; + } + + restorePage3(); + _mainCharacter.x2 = _mainCharacter.x1 = x; + _mainCharacter.y2 = _mainCharacter.y1 = y; + return 0; +} + int KyraEngine_v2::o2_defineObject(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "o2_defineObject(%p) (%d, '%s', %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); |