diff options
author | Florian Kagerer | 2009-06-01 01:24:17 +0000 |
---|---|---|
committer | Florian Kagerer | 2009-06-01 01:24:17 +0000 |
commit | 83dbcf8531c7703e3024a45e76c3794fa2327b79 (patch) | |
tree | 68e3473031b97d9f1930c266a2235eb218bba27f | |
parent | 60d53c3cce179ab08649fb78a93ca7118f364869 (diff) | |
download | scummvm-rg350-83dbcf8531c7703e3024a45e76c3794fa2327b79.tar.gz scummvm-rg350-83dbcf8531c7703e3024a45e76c3794fa2327b79.tar.bz2 scummvm-rg350-83dbcf8531c7703e3024a45e76c3794fa2327b79.zip |
LOL: some more opcodes and some minor bug fixes
svn-id: r41092
-rw-r--r-- | engines/kyra/lol.h | 1 | ||||
-rw-r--r-- | engines/kyra/script_lol.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/script_v1.cpp | 7 | ||||
-rw-r--r-- | engines/kyra/sound_lol.cpp | 2 |
4 files changed, 14 insertions, 4 deletions
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index 2bd33b38bc..79fecfbd9a 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -773,6 +773,7 @@ private: int olol_paletteFlash(EMCState *script); int olol_disableControls(EMCState *script); int olol_enableControls(EMCState *script); + int olol_shakeScene(EMCState *script); int olol_gasExplosion(EMCState *script); int olol_calcNewBlockPosition(EMCState *script); int olol_fadeScene(EMCState *script); diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index dbbafc3a54..ba0b5f4643 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -2067,6 +2067,12 @@ int LoLEngine::olol_enableControls(EMCState *script) { return gui_enableControls(); } +int LoLEngine::olol_shakeScene(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_shakeScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); + shakeScene(stackPos(0), stackPos(1), stackPos(2), 1); + return 1; +} + int LoLEngine::olol_gasExplosion(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_gasExplosion(%p) (%d)", (const void *)script, stackPos(0)); processGasExplosion(stackPos(0)); @@ -2738,7 +2744,7 @@ void LoLEngine::setupOpcodeTable() { // 0xB4 Opcode(olol_enableControls); - OpcodeUnImpl(); + Opcode(olol_shakeScene); Opcode(olol_gasExplosion); Opcode(olol_calcNewBlockPosition); diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp index f74c7e3560..0f36d5d12b 100644 --- a/engines/kyra/script_v1.cpp +++ b/engines/kyra/script_v1.cpp @@ -45,8 +45,11 @@ int KyraEngine_v1::o1_resetGameFlag(EMCState *script) { int KyraEngine_v1::o1_getRand(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); - assert(stackPos(0) < stackPos(1)); - return _rnd.getRandomNumberRng(stackPos(0), stackPos(1)); + int min = stackPos(0); + int max = stackPos(1); + if (max < min) + SWAP(min, max); + return _rnd.getRandomNumberRng(min, max); } int KyraEngine_v1::o1_hideMouse(EMCState *script) { diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp index 4247596399..a14df2090a 100644 --- a/engines/kyra/sound_lol.cpp +++ b/engines/kyra/sound_lol.cpp @@ -79,7 +79,7 @@ bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) { snprintf(file2, sizeof(file2), "%s%c%c.%s", pattern1, '_', symbol, pattern2); if (_sound->isVoicePresent(file1)) newSpeechList.push_back(_sound->getVoiceStream(file1)); - if (_sound->isVoicePresent(file2)) + else if (_sound->isVoicePresent(file2)) newSpeechList.push_back(_sound->getVoiceStream(file2)); else break; |