diff options
author | Florian Kagerer | 2009-03-14 15:06:02 +0000 |
---|---|---|
committer | Florian Kagerer | 2009-03-14 15:06:02 +0000 |
commit | 7fe0592f0facda5444124a9171cd2d95de4c0755 (patch) | |
tree | 008f8c5a725d4b221897754152f074b90c6f722b | |
parent | 498a355a74822974733ade011875e3446f655e96 (diff) | |
download | scummvm-rg350-7fe0592f0facda5444124a9171cd2d95de4c0755.tar.gz scummvm-rg350-7fe0592f0facda5444124a9171cd2d95de4c0755.tar.bz2 scummvm-rg350-7fe0592f0facda5444124a9171cd2d95de4c0755.zip |
LOL: magic atlas can now be picked up (but it can't be used)
svn-id: r39393
-rw-r--r-- | engines/kyra/gui_lol.cpp | 7 | ||||
-rw-r--r-- | engines/kyra/lol.h | 10 | ||||
-rw-r--r-- | engines/kyra/scene_lol.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/script_lol.cpp | 29 | ||||
-rw-r--r-- | engines/kyra/script_tim.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/script_tim.h | 4 | ||||
-rw-r--r-- | engines/kyra/sprites_lol.cpp | 2 |
7 files changed, 42 insertions, 20 deletions
diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index 4f56fa773e..ffc3009bdb 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -1398,6 +1398,13 @@ int LoLEngine::clickedCompass(Button *button) { } int LoLEngine::clickedAutomap(Button *button) { + if (!(_gameFlags[15] & 0x1000)) + return 0; + + // displayAutopmap(); + + gui_drawPlayField(); + setPaletteBrightness(_screen->_currentPalette, _brightness, _lampOilStatus); return 1; } diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index 3759953536..e6e4960fed 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -500,6 +500,8 @@ private: uint16 _globalScriptVars[16]; // emc opcode + int olol_setWallType(EMCState *script); + int olol_getWallType(EMCState *script); int olol_drawScene(EMCState *script); int olol_delay(EMCState *script); int olol_setGameFlag(EMCState *script); @@ -534,7 +536,7 @@ private: int olol_getGlobalVar(EMCState *script); int olol_setGlobalVar(EMCState *script); int olol_triggerDoorSwitch(EMCState *script); - int olol_updateSceneAnimations(EMCState *script); + int olol_updateBlockAnimations(EMCState *script); int olol_mapShapeToBlock(EMCState *script); int olol_resetBlockShapeAssignment(EMCState *script); int olol_copyRegion(EMCState *script); @@ -760,7 +762,7 @@ private: void drawDecorations(int index); void drawIceShapes(int index, int iceShapeIndex); void drawScriptShapes(int pageNum); - void updateSceneAnimations(int block, int wall, int val); + void setWallType(int block, int wall, int val); void updateSceneWindow(); void setSequenceGui(int x, int y, int w, int h, int enableFlags); @@ -796,7 +798,7 @@ private: void movePartySmoothScrollTurnRight(int speed); int smoothScrollDrawSpecialShape(int pageNum); - void setLF2(int block); + void updateAutoMap(int block); struct OpenDoorState { uint16 block; @@ -981,7 +983,7 @@ private: // monsters void loadMonsterShapes(const char *file, int monsterIndex, int b); void releaseMonsterShapes(int monsterIndex); - int placeMonstersUnk(int block); + int disableMonstersForBlock(int block); void setMonsterMode(MonsterInPlay *monster, int a); void placeMonster(MonsterInPlay *monster, uint16 x, uint16 y); int calcMonsterDirection(uint16 x1, uint16 y1, uint16 x2, uint16 y2); diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index 994f7f817f..1aa82fae94 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -84,7 +84,7 @@ void LoLEngine::loadLevel(int index) { runInfScript(filename); addLevelItems(); - placeMonstersUnk(_currentBlock); + disableMonstersForBlock(_currentBlock); _screen->generateGrayOverlay(_screen->_currentPalette, _screen->_grayOverlay,32, 16, 0, 0, 128, true); @@ -643,7 +643,7 @@ void LoLEngine::moveParty(uint16 direction, int unk1, int unk2, int buttonShape) } } - setLF2(_currentBlock); + updateAutoMap(_currentBlock); } uint16 LoLEngine::calcNewBlockPosition(uint16 curBlock, uint16 direction) { @@ -1103,7 +1103,7 @@ int LoLEngine::smoothScrollDrawSpecialShape(int pageNum) { return 0; } -void LoLEngine::setLF2(int block) { +void LoLEngine::updateAutoMap(int block) { if (!(_gameFlags[15] & 0x1000)) return; _levelBlockProperties[block].flags |= 7; @@ -1138,7 +1138,7 @@ void LoLEngine::drawScene(int pageNum) { _sceneUpdateRequired = false; } -void LoLEngine::updateSceneAnimations(int block, int wall, int val) { +void LoLEngine::setWallType(int block, int wall, int val) { if (wall == -1) { for (int i = 0; i < 4; i++) _levelBlockProperties[block].walls[i] = val; diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index d9a7d9cb6e..c8b025d2d6 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -112,6 +112,19 @@ bool LoLEngine::checkSceneUpdateNeed(int func) { return false; } +int LoLEngine::olol_setWallType(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_setWallType(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); + if (_wllWallFlags[stackPos(2)] & 4) + disableMonstersForBlock(stackPos(0)); + setWallType(stackPos(0), stackPos(1), stackPos(2)); + return 1; +} + +int LoLEngine::olol_getWallType(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_getWallType(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); + return _levelBlockProperties[stackPos(0)].walls[stackPos(1) & 3]; +} + int LoLEngine::olol_drawScene(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_drawScene(%p) (%d)", (const void *)script, stackPos(0)); drawScene(stackPos(0)); @@ -555,7 +568,7 @@ int LoLEngine::olol_setGlobalVar(EMCState *script) { case 0: _currentBlock = b; calcCoordinates(_partyPosX, _partyPosY, _currentBlock, 0x80, 0x80); - setLF2(_currentBlock); + updateAutoMap(_currentBlock); break; case 1: @@ -626,11 +639,11 @@ int LoLEngine::olol_triggerDoorSwitch(EMCState *script) { return 1; } -int LoLEngine::olol_updateSceneAnimations(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_updateSceneAnimations(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); +int LoLEngine::olol_updateBlockAnimations(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_updateBlockAnimations(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); int block = stackPos(0); int wall = stackPos(1); - updateSceneAnimations(block, wall, _levelBlockProperties[block].walls[(wall == -1) ? 0 : wall] == stackPos(2) ? stackPos(3) : stackPos(2)); + setWallType(block, wall, _levelBlockProperties[block].walls[(wall == -1) ? 0 : wall] == stackPos(2) ? stackPos(3) : stackPos(2)); return 0; } @@ -1031,7 +1044,7 @@ int LoLEngine::olol_setDoorState(EMCState *script) { int LoLEngine::olol_processButtonClick(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_processButtonClick(%p) (%d)", (const void *)script, stackPos(0)); - _tim->resetDialogueState(_activeTim[stackPos(0)]); + _tim->forceDialogue(_activeTim[stackPos(0)]); return 1; } @@ -1339,8 +1352,8 @@ void LoLEngine::setupOpcodeTable() { SetOpcodeTable(_opcodes); // 0x00 - OpcodeUnImpl(); - OpcodeUnImpl(); + Opcode(olol_setWallType); + Opcode(olol_getWallType); Opcode(olol_drawScene); Opcode(o1_getRand); @@ -1417,7 +1430,7 @@ void LoLEngine::setupOpcodeTable() { OpcodeUnImpl(); // 0x34 - Opcode(olol_updateSceneAnimations); + Opcode(olol_updateBlockAnimations); Opcode(olol_mapShapeToBlock); Opcode(olol_resetBlockShapeAssignment); Opcode(olol_copyRegion); diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index 207f53b8de..c1bb094fee 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -1125,7 +1125,7 @@ uint16 TIMInterpreter_LoL::processDialogue() { return res; } -void TIMInterpreter_LoL::resetDialogueState(TIM *tim) { +void TIMInterpreter_LoL::forceDialogue(TIM *tim) { if (!tim) return; diff --git a/engines/kyra/script_tim.h b/engines/kyra/script_tim.h index f73c63a2c7..b88a88c7f6 100644 --- a/engines/kyra/script_tim.h +++ b/engines/kyra/script_tim.h @@ -144,7 +144,7 @@ public: virtual void stopBackgroundAnimation(int animIndex) {} virtual void updateBackgroundAnimation(int animIndex) {} - virtual void resetDialogueState(TIM *tim) {} + virtual void forceDialogue(TIM *tim) {} int _drawPage2; @@ -236,7 +236,7 @@ public: void stopBackgroundAnimation(int animIndex); void updateBackgroundAnimation(int animIndex); - void resetDialogueState(TIM *tim); + void forceDialogue(TIM *tim); private: KyraEngine_v1 *vm(); diff --git a/engines/kyra/sprites_lol.cpp b/engines/kyra/sprites_lol.cpp index 9b59181d62..d9de39db97 100644 --- a/engines/kyra/sprites_lol.cpp +++ b/engines/kyra/sprites_lol.cpp @@ -135,7 +135,7 @@ void LoLEngine::releaseMonsterShapes(int monsterIndex) { } } -int LoLEngine::placeMonstersUnk(int block) { +int LoLEngine::disableMonstersForBlock(int block) { int i = _levelBlockProperties[block].itemMonsterIndex; int cnt = 0; MonsterInPlay *t = 0; |