LOL: some more opcodes and some minor bug fixes

svn-id: r41092
This commit is contained in:
Florian Kagerer 2009-06-01 01:24:17 +00:00
parent 60d53c3cce
commit 83dbcf8531
4 changed files with 14 additions and 4 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -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;