aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2008-04-23 17:08:34 +0000
committerJohannes Schickel2008-04-23 17:08:34 +0000
commit79d6c9f04209774f5222e161136627c07beb1013 (patch)
treef75508a55adee40a5af86306af929377103755ce /engines
parent5572f694c074e715cd33c56e875c753915b76fda (diff)
downloadscummvm-rg350-79d6c9f04209774f5222e161136627c07beb1013.tar.gz
scummvm-rg350-79d6c9f04209774f5222e161136627c07beb1013.tar.bz2
scummvm-rg350-79d6c9f04209774f5222e161136627c07beb1013.zip
- Implemented opcode: 14: o3_moveCharacter
- Fixed opcode 44 and renamed it to o3_handItemSet, this fixes loads of input and enter scene facing problems. svn-id: r31665
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/kyra_v3.h4
-rw-r--r--engines/kyra/scene_v3.cpp2
-rw-r--r--engines/kyra/script_v3.cpp34
3 files changed, 31 insertions, 9 deletions
diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_v3.h
index cc497cb43d..0e7efe91be 100644
--- a/engines/kyra/kyra_v3.h
+++ b/engines/kyra/kyra_v3.h
@@ -587,6 +587,7 @@ private:
int o3_getCharacterScene(ScriptState *script);
int o3_getMalcolmsSpirit(ScriptState *script);
int o3_trySceneChange(ScriptState *script);
+ int o3_moveCharacter(ScriptState *script);
int o3_showSceneFileMessage(ScriptState *script);
int o3_showBadConscience(ScriptState *script);
int o3_hideBadConscience(ScriptState *script);
@@ -599,7 +600,7 @@ private:
int o3_setGameFlag(ScriptState *script);
int o3_setHandItem(ScriptState *script);
int o3_removeHandItem(ScriptState *script);
- int o3_getHandItem(ScriptState *script);
+ int o3_handItemSet(ScriptState *script);
int o3_hideMouse(ScriptState *script);
int o3_addSpecialExit(ScriptState *script);
int o3_setMousePos(ScriptState *script);
@@ -619,6 +620,7 @@ private:
int o3_stopMusic(ScriptState *script);
int o3_playMusicTrack(ScriptState *script);
int o3_playSoundEffect(ScriptState *script);
+ int o3_blockOutRegion(ScriptState *script);
int o3_getRand(ScriptState *script);
int o3_defineRoomEntrance(ScriptState *script);
int o3_setSpecialSceneScriptRunTime(ScriptState *script);
diff --git a/engines/kyra/scene_v3.cpp b/engines/kyra/scene_v3.cpp
index f54706618e..3e2864375c 100644
--- a/engines/kyra/scene_v3.cpp
+++ b/engines/kyra/scene_v3.cpp
@@ -136,11 +136,9 @@ void KyraEngine_v3::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2
_sceneExit3 = _sceneList[sceneId].exit3;
_sceneExit4 = _sceneList[sceneId].exit4;
-
while (_system->getMillis() < waitUntilTimer)
_system->delayMillis(10);
-
musicUpdate(0);
initSceneScript(unk3);
musicUpdate(0);
diff --git a/engines/kyra/script_v3.cpp b/engines/kyra/script_v3.cpp
index 40367af5d4..f74a9f2417 100644
--- a/engines/kyra/script_v3.cpp
+++ b/engines/kyra/script_v3.cpp
@@ -132,6 +132,12 @@ int KyraEngine_v3::o3_trySceneChange(ScriptState *script) {
}
}
+int KyraEngine_v3::o3_moveCharacter(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_moveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ moveCharacter(stackPos(0), stackPos(1), stackPos(2));
+ return 0;
+}
+
int KyraEngine_v3::o3_showSceneFileMessage(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showSceneFileMessage(%p) (%d)", (const void *)script, stackPos(0));
showMessage((const char*)getTableEntry(_scenesFile, stackPos(0)), 0xFF, 0xF0);
@@ -216,9 +222,9 @@ int KyraEngine_v3::o3_removeHandItem(ScriptState *script) {
return 0;
}
-int KyraEngine_v3::o3_getHandItem(ScriptState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getHandItem(%p) ()", (const void *)script);
- return _itemInHand;
+int KyraEngine_v3::o3_handItemSet(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_handItemSet(%p) ()", (const void *)script);
+ return _handItemSet;
}
int KyraEngine_v3::o3_hideMouse(ScriptState *script) {
@@ -618,6 +624,22 @@ int KyraEngine_v3::o3_playSoundEffect(ScriptState *script) {
return 0;
}
+int KyraEngine_v3::o3_blockOutRegion(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ const int x1 = stackPos(0);
+ int y1 = stackPos(1);
+ const int x2 = stackPos(2);
+ int y2 = stackPos(3);
+
+ if (y1 < _maskPageMinY)
+ y1 = _maskPageMinY;
+ if (y2 > _maskPageMaxY)
+ y2 = _maskPageMaxY;
+
+ _screen->blockOutRegion(x1, y1, x2-x1+1, y2-y1+1);
+ return 0;
+}
+
int KyraEngine_v3::o3_getRand(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
assert(stackPos(0) < stackPos(1));
@@ -978,7 +1000,7 @@ void KyraEngine_v3::setupOpcodeTable() {
// 0x0c
OpcodeUnImpl();
Opcode(o3_trySceneChange);
- OpcodeUnImpl();
+ Opcode(o3_moveCharacter);
OpcodeUnImpl();
// 0x10
OpcodeUnImpl();
@@ -1016,7 +1038,7 @@ void KyraEngine_v3::setupOpcodeTable() {
Opcode(o3_setHandItem);
Opcode(o3_removeHandItem);
// 0x2c
- Opcode(o3_getHandItem);
+ Opcode(o3_handItemSet);
Opcode(o3_hideMouse);
Opcode(o3_addSpecialExit);
Opcode(o3_setMousePos);
@@ -1076,7 +1098,7 @@ void KyraEngine_v3::setupOpcodeTable() {
OpcodeUnImpl();
OpcodeUnImpl();
// 0x5c
- OpcodeUnImpl();
+ Opcode(o3_blockOutRegion);
Opcode(o3_dummy);
OpcodeUnImpl();
OpcodeUnImpl();