diff options
author | Johannes Schickel | 2008-04-23 21:07:58 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-04-23 21:07:58 +0000 |
commit | 68613025ab0c87e4c9316f917bbb800d87b3aba2 (patch) | |
tree | 66387e1d113526ca5a387bc209b15f1e0191ab44 | |
parent | 97932a8f32b5fefb6b6d14441a68a1b3f8e42fd7 (diff) | |
download | scummvm-rg350-68613025ab0c87e4c9316f917bbb800d87b3aba2.tar.gz scummvm-rg350-68613025ab0c87e4c9316f917bbb800d87b3aba2.tar.bz2 scummvm-rg350-68613025ab0c87e4c9316f917bbb800d87b3aba2.zip |
Cleanup. (and little addition to showInventory)
svn-id: r31679
-rw-r--r-- | engines/kyra/gui_v3.cpp | 38 | ||||
-rw-r--r-- | engines/kyra/kyra_v3.cpp | 11 | ||||
-rw-r--r-- | engines/kyra/kyra_v3.h | 13 | ||||
-rw-r--r-- | engines/kyra/script_v3.cpp | 22 |
4 files changed, 61 insertions, 23 deletions
diff --git a/engines/kyra/gui_v3.cpp b/engines/kyra/gui_v3.cpp index dff5db9da5..315be352e9 100644 --- a/engines/kyra/gui_v3.cpp +++ b/engines/kyra/gui_v3.cpp @@ -25,6 +25,7 @@ #include "kyra/kyra_v3.h" #include "kyra/text_v3.h" +#include "kyra/wsamovie.h" namespace Kyra { @@ -79,13 +80,13 @@ void KyraEngine_v3::showInventory() { return; _screen->copyBlockToPage(3, 0, 0, 320, 56, _interface); - updateMalcolmSpiritText(); + drawMalcolmsMoodText(); _inventoryState = true; updateCLState(); redrawInventory(30); - + drawMalcolmsMoodPointer(-1, 30); //XXX if (queryGameFlag(0x97)) @@ -214,14 +215,14 @@ void KyraEngine_v3::hideInventory() { _screen->showMouse(); } -void KyraEngine_v3::updateMalcolmSpiritText() { - debugC(9, kDebugLevelMain, "KyraEngine_v3::updateMalcolmSpiritText()"); +void KyraEngine_v3::drawMalcolmsMoodText() { + debugC(9, kDebugLevelMain, "KyraEngine_v3::drawMalcolmsMoodText()"); static const int stringId[] = { 0x32, 0x37, 0x3C }; if (queryGameFlag(0x219)) return; - const char *string = (const char*)getTableEntry(_cCodeFile, stringId[_malcolmsSpirit]); + const char *string = (const char*)getTableEntry(_cCodeFile, stringId[_malcolmsMood]); Screen::FontId oldFont = _screen->setFont(Screen::FID_8_FNT); _screen->_charWidth = -2; @@ -249,6 +250,33 @@ void KyraEngine_v3::updateMalcolmSpiritText() { _screen->_curPage = pageBackUp; } +void KyraEngine_v3::drawMalcolmsMoodPointer(int frame, int page) { + debugC(9, kDebugLevelMain, "KyraEngine_v3::drawMalcolmsMoodPointer(%d, %d)", frame, page); + static const int stateTable[] = { + 1, 6, 11 + }; + + if (frame == -1) + frame = stateTable[_malcolmsMood]; + if (queryGameFlag(0x219)) + frame = 13; + + if (page == 0) { + _invWsa->setX(0); + _invWsa->setY(0); + _invWsa->setDrawPage(0); + _invWsa->displayFrame(frame, 0); + _screen->updateScreen(); + } else if (page == 30) { + _invWsa->setX(0); + _invWsa->setY(-144); + _invWsa->setDrawPage(2); + _invWsa->displayFrame(frame, 0); + } + + _invWsaFrame = frame; +} + void KyraEngine_v3::drawJestersStaff(int type, int page) { debugC(9, kDebugLevelMain, "KyraEngine_v3::drawJestersStaff(%d, %d)", type, page); int y = 155; diff --git a/engines/kyra/kyra_v3.cpp b/engines/kyra/kyra_v3.cpp index e2641311a3..0c0b5e2415 100644 --- a/engines/kyra/kyra_v3.cpp +++ b/engines/kyra/kyra_v3.cpp @@ -120,12 +120,14 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngi memset(&_dialogScriptData, 0, sizeof(_dialogScriptData)); memset(&_dialogScriptState, 0, sizeof(_dialogScriptState)); _dialogScriptFuncStart = _dialogScriptFuncProc = _dialogScriptFuncEnd = 0; - _malcolmsSpirit = 1; + _malcolmsMood = 1; _nextIdleAnim = 0; _nextIdleType = false; _newShapeFlag = -1; _newShapeFiledata = 0; _inventoryScrollSpeed = -1; + _invWsa = 0; + _invWsaFrame = -1; } KyraEngine_v3::~KyraEngine_v3() { @@ -183,6 +185,7 @@ KyraEngine_v3::~KyraEngine_v3() { delete _dlgBuffer; delete [] _stringBuffer; delete [] _newShapeFiledata; + delete _invWsa; } int KyraEngine_v3::init() { @@ -613,7 +616,11 @@ void KyraEngine_v3::startup() { _sceneList = new SceneDesc[98]; musicUpdate(0); runStartupScript(1, 0); - //openMoondomtrWsa(); + _res->exists("MOODOMTR.WSA", true); + _invWsa = new WSAMovieV2(this, _screen); + assert(_invWsa); + _invWsa->open("MOODOMTR.WSA", 1, 0); + _invWsaFrame = 6; _soundDigital->beginFadeOut(_musicSoundChannel, 60); delayWithTicks(60); enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1); diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_v3.h index 60732fda5d..e9036a61a4 100644 --- a/engines/kyra/kyra_v3.h +++ b/engines/kyra/kyra_v3.h @@ -257,8 +257,8 @@ private: void showInventory(); void hideInventory(); - void updateMalcolmSpiritText(); - //void updateMalcolmSpiritPtr(); + void drawMalcolmsMoodText(); + void drawMalcolmsMoodPointer(int frame, int page); void drawJestersStaff(int type, int page); static const uint8 _inventoryX[]; @@ -267,6 +267,9 @@ private: void clearInventorySlot(int slot, int page); void drawInventorySlot(int page, int item, int slot); + WSAMovieV2 *_invWsa; + int _invWsaFrame; + // localization uint8 *_scoreFile; uint8 *_cCodeFile; @@ -475,7 +478,7 @@ private: bool checkCharCollision(int x, int y); - int _malcolmsSpirit; + int _malcolmsMood; // talk object struct TalkObject { @@ -621,7 +624,7 @@ private: int o3_getCharacterY(ScriptState *script); int o3_getCharacterFacing(ScriptState *script); int o3_getCharacterScene(ScriptState *script); - int o3_getMalcolmsSpirit(ScriptState *script); + int o3_getMalcolmsMood(ScriptState *script); int o3_trySceneChange(ScriptState *script); int o3_moveCharacter(ScriptState *script); int o3_showSceneFileMessage(ScriptState *script); @@ -643,7 +646,7 @@ private: int o3_showMouse(ScriptState *script); int o3_badConscienceChat(ScriptState *script); int o3_wipeDownMouseItem(ScriptState *script); - int o3_setMalcolmsSpirit(ScriptState *script); + int o3_setMalcolmsMood(ScriptState *script); int o3_delay(ScriptState *script); int o3_setSceneFilename(ScriptState *script); int o3_drawSceneShape(ScriptState *script); diff --git a/engines/kyra/script_v3.cpp b/engines/kyra/script_v3.cpp index b5261f16a1..f4c674e510 100644 --- a/engines/kyra/script_v3.cpp +++ b/engines/kyra/script_v3.cpp @@ -108,9 +108,9 @@ int KyraEngine_v3::o3_getCharacterScene(ScriptState *script) { return _mainCharacter.sceneId; } -int KyraEngine_v3::o3_getMalcolmsSpirit(ScriptState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getMalcolmsSpirit(%p) ()", (const void *)script); - return _malcolmsSpirit; +int KyraEngine_v3::o3_getMalcolmsMood(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getMalcolmsMood(%p) ()", (const void *)script); + return _malcolmsMood; } int KyraEngine_v3::o3_trySceneChange(ScriptState *script) { @@ -294,9 +294,9 @@ int KyraEngine_v3::o3_wipeDownMouseItem(ScriptState *script) { return 0; } -int KyraEngine_v3::o3_setMalcolmsSpirit(ScriptState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setMalcolmsSpirit(%p) (%d)", (const void *)script, stackPos(0)); - return (_malcolmsSpirit = stackPos(0)); +int KyraEngine_v3::o3_setMalcolmsMood(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setMalcolmsMood(%p) (%d)", (const void *)script, stackPos(0)); + return (_malcolmsMood = stackPos(0)); } int KyraEngine_v3::o3_delay(ScriptState *script) { @@ -537,13 +537,13 @@ int KyraEngine_v3::o3_updateConversations(ScriptState *script) { break; } } else if (_curChapter == 4) { - if (_malcolmsSpirit == 0) { + if (_malcolmsMood == 0) { convs[0] = _mainCharacter.dlgIndex - 10; convs[1] = _mainCharacter.dlgIndex - 5; - } else if (_malcolmsSpirit == 1) { + } else if (_malcolmsMood == 1) { convs[0] = _mainCharacter.dlgIndex + 5; convs[1] = _mainCharacter.dlgIndex + 10; - } else if (_malcolmsSpirit == 2) { + } else if (_malcolmsMood == 2) { convs[0] = _mainCharacter.dlgIndex - 5; convs[1] = _mainCharacter.dlgIndex + 5; } @@ -1003,7 +1003,7 @@ void KyraEngine_v3::setupOpcodeTable() { Opcode(o3_getCharacterFacing); Opcode(o3_getCharacterScene); // 0x08 - Opcode(o3_getMalcolmsSpirit); + Opcode(o3_getMalcolmsMood); Opcode(o3_dummy); Opcode(o3_dummy); OpcodeUnImpl(); @@ -1058,7 +1058,7 @@ void KyraEngine_v3::setupOpcodeTable() { Opcode(o3_wipeDownMouseItem); Opcode(o3_dummy); // 0x34 - Opcode(o3_setMalcolmsSpirit); + Opcode(o3_setMalcolmsMood); OpcodeUnImpl(); Opcode(o3_dummy); Opcode(o3_delay); |