From d866b246052006183195c1cb7f2a862ff613349a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 9 Jan 2016 09:56:09 +1100 Subject: [PATCH] MADS: Implement bulk of remaining conversation setup and support methods --- engines/mads/conversations.cpp | 253 ++++++++++++++---- engines/mads/conversations.h | 172 ++++++++++-- .../dragonsphere/dragonsphere_scenes1.cpp | 6 +- engines/mads/phantom/phantom_scenes1.cpp | 12 +- engines/mads/phantom/phantom_scenes2.cpp | 18 +- engines/mads/phantom/phantom_scenes5.cpp | 40 +-- 6 files changed, 388 insertions(+), 113 deletions(-) diff --git a/engines/mads/conversations.cpp b/engines/mads/conversations.cpp index 0f51d96c0c32..2af74541f7ce 100644 --- a/engines/mads/conversations.cpp +++ b/engines/mads/conversations.cpp @@ -31,11 +31,17 @@ namespace MADS { GameConversations::GameConversations(MADSEngine *vm) : _vm(vm) { _runningConv = nullptr; _restoreRunning = 0; - _nextStartNode = nullptr; _playerEnabled = false; _inputMode = kInputBuildingSentences; _startFrameNumber = 0; - _val1 = _val2 = _val3 = _val4 = _val5 = 0; + _speakerVal = 0; + _heldVal = _releaseVal = 0; + _val1 =_val5 = 0; + _vars = _nextStartNode = nullptr; + _heroTrigger = 0; + _heroTriggerMode = SEQUENCE_TRIGGER_PARSER; + _interlocutorTrigger = 0; + _interlocutorTriggerMode = SEQUENCE_TRIGGER_PARSER; // Mark all conversation slots as empty for (int idx = 0; idx < MAX_CONVERSATIONS; ++idx) @@ -90,8 +96,10 @@ void GameConversations::run(int id) { _startFrameNumber = _vm->_events->getFrameCounter(); _playerEnabled = _vm->_game->_player._stepEnabled; _inputMode = _vm->_game->_screenObjects._inputMode; - _val1 = _val2 = _val3 = 0; - _val4 = 0; + _heroTrigger = 0; + _interlocutorTrigger = 0; + _val1 = 0; + _heldVal = 0; _val5 = -1; // Initialize speaker arrays @@ -105,28 +113,14 @@ void GameConversations::run(int id) { // Start the conversation start(); - // Set variables - setVariable(2, 0x4F78); - setVariable(3, 0x4F50); - setVariable(4, 0x4F52); - setVariable(5, 0x4F54); - setVariable(6, 0x4F56); - setVariable(7, 0x4F58); - setVariable(8, 0x4F5A); - setVariable(9, 0x4F5C); - setVariable(10, 0x4F5E); - setVariable(11, 0x4F60); - setVariable(12, 0x4F62); - setVariable(13, 0x4F64); - setVariable(14, 0x4F66); - setVariable(15, 0x4F68); - setVariable(16, 0x4F6A); - setVariable(17, 0x4F6C); - setVariable(18, 0x4F6E); - setVariable(19, 0x4F70); - setVariable(20, 0x4F72); - setVariable(21, 0x4F74); - setVariable(22, 0x4F76); + // Setup variables to point to data in the speaker arrays + setVariable(2, &_speakerVal); + for (int idx = 0; idx < MAX_SPEAKERS; ++idx) { + setVariable(3 + idx, &_speakerExists[idx]); + setVariable(8 + idx, &_arr4[idx]); + setVariable(13 + idx, &_arr5[idx]); + setVariable(18 + idx, &_arr6[idx]); + } // Load sprite data for speaker portraits for (uint idx = 0; idx < _runningConv->_data._speakerCount; ++idx) { @@ -145,58 +139,148 @@ void GameConversations::run(int id) { } void GameConversations::start() { + assert(_runningConv->_cnd._vars.size() >= 2); + _vars = &_runningConv->_cnd._vars[0]; + _nextStartNode = &_runningConv->_cnd._vars[1]; warning("TODO: GameConversations::start"); } -void GameConversations::setVariable(uint idx, int v1, int v2) { - if (active()) { - _runningConv->_cnd._vars[idx].v1 = v1; - _runningConv->_cnd._vars[idx].v2 = v2; - } +void GameConversations::setVariable(uint idx, int val) { + if (active()) + _runningConv->_cnd._vars[idx].setValue(val); +} + +void GameConversations::setVariable(uint idx, int *val) { + if (active()) + _runningConv->_cnd._vars[idx].setValue(val); +} + +void GameConversations::setStartNode(uint nodeIndex) { + assert(_nextStartNode && _nextStartNode->_isPtr == false); + _nextStartNode->_val = nodeIndex; } void GameConversations::stop() { - warning("TODO GameConversations::stop"); + // Only need to proceed if there is an active conversation + if (!active()) + return; + + // Reset player enabled state if needed + if (_vm->_game->_kernelMode == KERNEL_ACTIVE_CODE) + _vm->_game->_player._stepEnabled = _playerEnabled; + + // Remove any visible dialog window + removeActiveWindow(); + + // Release any sprites used for character portraits + for (int idx = 0; idx < _runningConv->_data._speakerCount; ++idx) { + if (_speakerActive[idx]) + _vm->_game->_scene._sprites.remove(_speakerPortraits[idx]); + } + + // Flag conversation as no longer running + _runningConv = nullptr; + + if (_inputMode == kInputConversation) + _vm->_game->_scene._userInterface.emptyConversationList(); + + _vm->_game->_scene._userInterface.setup(_inputMode); } -void GameConversations::exportPointer(int *val) { - warning("TODO GameConversations::exportPointer"); +void GameConversations::exportPointer(int *ptr) { + // Only need to proceed if there is an active conversation + if (!active()) + return; + + // Also don't proceed if the number of allowed imports has already been reached + if (_runningConv->_cnd._numImports >= _runningConv->_data._maxImports) + return; + + // Get the variable to use for this next import and set it's value + int variableIndex = _runningConv->_cnd._importVariables[ + _runningConv->_cnd._numImports++]; + setVariable(variableIndex, ptr); } void GameConversations::exportValue(int val) { - warning("TODO GameConversations::exportValue"); + // Only need to proceed if there is an active conversation + if (!active()) + return; + + // Also don't proceed if the number of allowed imports has already been reached + if (_runningConv->_cnd._numImports >= _runningConv->_data._maxImports) + return; + + // Get the variable to use for this next import and set it's value + int variableIndex = _runningConv->_cnd._importVariables[ + _runningConv->_cnd._numImports++]; + setVariable(variableIndex, val); } void GameConversations::setHeroTrigger(int val) { - _vm->_game->_trigger = val; // HACK - //_running = -1; // HACK - warning("TODO: GameConversations::setHeroTrigger"); + _heroTrigger = val; + _heroTriggerMode = _vm->_game->_triggerSetupMode; } void GameConversations::setInterlocutorTrigger(int val) { - warning("TODO: GameConversations::setInterlocutorTrigger"); + _interlocutorTrigger = val; + _interlocutorTriggerMode = _vm->_game->_triggerSetupMode; } -int* GameConversations::getVariable(int idx) { - warning("TODO: GameConversations::getVariable"); - return nullptr; +int *GameConversations::getVariable(int idx) { + return _vars[idx].getValue(); } void GameConversations::hold() { - warning("TODO: GameConversations::hold"); + if (_heldVal != -1) { + _releaseVal = _heldVal; + _heldVal = -1; + } } void GameConversations::release() { - warning("TODO: GameConversations::release"); + if (_heldVal == -1) { + _heldVal = _releaseVal; + if (_heldVal == 1 || _heldVal == 2) + update(true); + } +} + +void GameConversations::flagEntry(ConvFlagMode mode, int entryIndex) { + assert(_runningConv); + uint &flags = _runningConv->_cnd._entryFlags[entryIndex]; + + switch (mode) { + case FLAGMODE_1: + flags |= ENTRYFLAG_4000; + flags &= ~ENTRYFLAG_8000; + break; + + case FLAGMODE_2: + flags &= ~ENTRYFLAG_8000; + break; + + case FLAGMODE_3: + if (!(flags & ENTRYFLAG_4000)) + flags |= ENTRYFLAG_8000; + break; + + default: + break; + } } void GameConversations::reset(int id) { warning("TODO: GameConversations::reset"); } -void GameConversations::abortConv() { - warning("TODO: GameConversations::abort"); +void GameConversations::update(bool isRelease) { + warning("TODO: GameConversations::update"); +} + +void GameConversations::removeActiveWindow() { + warning("TODO: GameConversations::removeActiveWindow"); } /*------------------------------------------------------------------------*/ @@ -207,15 +291,16 @@ void ConversationData::load(const Common::String &filename) { inFile.open(filename); MadsPack convFileUnpacked(&inFile); - Common::SeekableReadStream *convFile = convFileUnpacked.getItemStream(0); // **** Section 0: Header ************************************************* + Common::SeekableReadStream *convFile = convFileUnpacked.getItemStream(0); + _nodeCount = convFile->readUint16LE(); _dialogCount = convFile->readUint16LE(); _messageCount = convFile->readUint16LE(); _textLineCount = convFile->readUint16LE(); _unk2 = convFile->readUint16LE(); - _importCount = convFile->readUint16LE(); + _maxImports = convFile->readUint16LE(); _speakerCount = convFile->readUint16LE(); for (uint idx = 0; idx < MAX_SPEAKERS; ++idx) { @@ -275,7 +360,7 @@ void ConversationData::load(const Common::String &filename) { // **** Section 3: Messages *********************************************** convFile = convFileUnpacked.getItemStream(3); - assert(convFile->size() == _messageCount * 8); + assert(convFile->size() == _messageCount * 4); _messages.resize(_messageCount); for (uint idx = 0; idx < _messageCount; ++idx) @@ -389,8 +474,74 @@ void ConversationData::load(const Common::String &filename) { /*------------------------------------------------------------------------*/ -void ConversationCnd::load(const Common::String &filename) { - // TODO +void ConversationConditionals::load(const Common::String &filename) { + Common::File inFile; + Common::SeekableReadStream *convFile; + + inFile.open(filename); + MadsPack convFileUnpacked(&inFile); + + // **** Section 0: Header ************************************************* + convFile = convFileUnpacked.getItemStream(0); + + convFile->skip(2); + int entryFlagsCount = convFile->readUint16LE(); + int varsCount = convFile->readUint16LE(); + int importsCount = convFile->readUint16LE(); + + delete convFile; + + // **** Section: Imports ************************************************* + int streamNum = 1; + + _importVariables.resize(importsCount); + if (importsCount > 0) { + convFile = convFileUnpacked.getItemStream(streamNum++); + + // Read in the variable indexes that each import value will be stored in + for (int idx = 0; idx < importsCount; ++idx) + _importVariables[idx] = convFile->readUint16LE(); + + delete convFile; + } + + // **** Section: Entry Flags ********************************************* + convFile = convFileUnpacked.getItemStream(streamNum++); + assert(convFile->size() == (entryFlagsCount * 2)); + + _entryFlags.resize(entryFlagsCount); + for (int idx = 0; idx < entryFlagsCount; ++idx) + _entryFlags[idx] = convFile->readUint16LE(); + + delete convFile; + + // **** Section: Variables *********************************************** + convFile = convFileUnpacked.getItemStream(streamNum); + assert(convFile->size() == (varsCount * 6)); + + _vars.resize(varsCount); + for (int idx = 0; idx < varsCount; ++idx) { + convFile->skip(2); // Loaded values are never pointers, so don't need this + _vars[idx]._isPtr = false; + _vars[idx]._val = convFile->readSint16LE(); + convFile->skip(2); // Unused segment selector for pointer values + } + + delete convFile; +} + +/*------------------------------------------------------------------------*/ + +void ConversationVar::setValue(int val) { + _isPtr = false; + _valPtr = nullptr; + _val = val; +} + +void ConversationVar::setValue(int *val) { + _isPtr = true; + _valPtr = val; + _val = 0; } } // End of namespace MADS diff --git a/engines/mads/conversations.h b/engines/mads/conversations.h index b50b87cb9868..657abae249a1 100644 --- a/engines/mads/conversations.h +++ b/engines/mads/conversations.h @@ -47,6 +47,20 @@ enum DialogCommands { cmdDialogEnd = 255 }; +enum ConvFlagMode { + FLAGMODE_1 = 1, + FLAGMODE_2 = 2, + FLAGMODE_3 = 3 +}; + +enum ConvEntryFlag { + ENTRYFLAG_4000 = 0x4000, + ENTRYFLAG_8000 = 0x8000 +}; + +/** + * Reperesents the data for a dialog to be displayed in a conversation + */ struct ConvDialog { int16 _textLineIndex; // 0-based int16 _speechIndex; // 1-based @@ -54,6 +68,9 @@ struct ConvDialog { uint16 _nodeSize; // size in section 6 }; +/** + * Represents a node within the conversation control logic + */ struct ConvNode { uint16 _index; uint16 _dialogCount; @@ -64,13 +81,16 @@ struct ConvNode { Common::Array _dialogs; }; +/** + * Represents the static, non-changing data for a conversation + */ struct ConversationData { uint16 _nodeCount; // conversation nodes, each one containing several dialog options and messages uint16 _dialogCount; // messages (non-selectable) + texts (selectable) uint16 _messageCount; // messages (non-selectable) uint16 _textLineCount; uint16 _unk2; - uint16 _importCount; + uint16 _maxImports; uint16 _speakerCount; int _textSize; int _commandsSize; @@ -88,29 +108,66 @@ struct ConversationData { void load(const Common::String &filename); }; -struct ConversationCnd { - struct ConversationVar { - int v1; - int v2; - int v3; - }; +struct ConversationVar { + bool _isPtr; + int _val; + int *_valPtr; + + /** + * Constructor + */ + ConversationVar() : _isPtr(false), _val(0), _valPtr(nullptr) {} + + /** + * Sets a numeric value + */ + void setValue(int val); + + /** + * Sets a pointer value + */ + void setValue(int *val); + /** + * Return either the variable's pointer, or a pointer to it's direct value + */ + int *getValue() { return _isPtr ? _valPtr : &_val; } +}; + +/** + * Conditional (i.e. changeable) data for the conversation + */ +struct ConversationConditionals { + Common::Array _importVariables; + Common::Array _entryFlags; Common::Array _vars; + int _numImports; /** - * Load the specified conversation resource file + * Constructor + */ + ConversationConditionals() : _numImports(0) {} + + /** + * Load the specified conversation conditionals resource file */ void load(const Common::String &filename); }; +/** + * Represents all the data needed for a particular loaded conversation + */ struct ConversationEntry { int _convId; ConversationData _data; - ConversationCnd _cnd; + ConversationConditionals _cnd; }; class MADSEngine; +/** + * Manager for loading and running conversations + */ class GameConversations { private: MADSEngine *_vm; @@ -122,8 +179,20 @@ class GameConversations { int _arr5[MAX_SPEAKERS]; int _arr6[MAX_SPEAKERS]; InputMode _inputMode; - int _val1, _val2, _val3, _val4, _val5; - + int _val1, _val5; + int _heldVal, _releaseVal; + int _speakerVal; + int _heroTrigger; + TriggerMode _heroTriggerMode; + int _interlocutorTrigger; + TriggerMode _interlocutorTriggerMode; + ConversationEntry *_runningConv; + int _restoreRunning; + bool _playerEnabled; + uint32 _startFrameNumber; + ConversationVar *_vars; + ConversationVar *_nextStartNode; + /** * Returns the record for the specified conversation, if it's loaded */ @@ -133,11 +202,16 @@ class GameConversations { * Start a specified conversation slot */ void start(); -public: - ConversationEntry *_runningConv; - int _restoreRunning; - bool _playerEnabled; - uint32 _startFrameNumber; + + /** + * Remove any currently active dialog window + */ + void removeActiveWindow(); + + /** + * Flags a conversation option/entry + */ + void flagEntry(ConvFlagMode mode, int entryIndex); public: /** * Constructor @@ -162,23 +236,68 @@ class GameConversations { void run(int id); /** - * Sets a variable + * Sets a variable to a numeric value */ - void setVariable(uint idx, int v1, int v2 = -1); + void setVariable(uint idx, int val); - int* _nextStartNode; - int* getVariable(int idx); + /** + * Sets a variable to a pointer value + */ + void setVariable(uint idx, int *val); - void stop(); - void exportPointer(int *val); - void exportValue(int val); + /** + * Sets the starting node index + */ + void setStartNode(uint nodeIndex); + + /** + * Set the hero trigger + */ void setHeroTrigger(int val); + + /** + * Set the interlocutor trigger + */ void setInterlocutorTrigger(int val); + + /** + * Returns either the pointer value of a variable, or if the variable + * contains a numeric value directly, returns a pointer to it + */ + int *getVariable(int idx); + + /** + * Hold a ??? value + */ void hold(); + + /** + * Release a prevoiusly held value + */ void release(); + + /** + * Stop any currently running conversation + */ + void stop(); + + /** + * Adds the passed pointer into the list of import variables for the given conversation + */ + void exportPointer(int *ptr); + + /** + * Adds the passed value into the list of import variables for the given conversation + */ + void exportValue(int val); + void reset(int id); - void abortConv(); + /** + * Handles updating the conversation display + */ + void update(bool isRelease); + /** * Returns true if any conversation is currently atcive */ @@ -188,6 +307,11 @@ class GameConversations { * Returns the currently active conversation Id */ int activeConvId() const { return !active() ? -1 : _runningConv->_convId; } + + /** + * Returns _restoreRunning value + */ + int restoreRunning() const { return _restoreRunning; } }; } // End of namespace MADS diff --git a/engines/mads/dragonsphere/dragonsphere_scenes1.cpp b/engines/mads/dragonsphere/dragonsphere_scenes1.cpp index 7d09c616aca4..ee32a0fdef8a 100644 --- a/engines/mads/dragonsphere/dragonsphere_scenes1.cpp +++ b/engines/mads/dragonsphere/dragonsphere_scenes1.cpp @@ -1332,7 +1332,7 @@ void Scene104::enter() { _scene->_dynamicHotspots[idx]._articleNumber = PREP_ON; _scene->setDynamicAnim(idx, _globals._animationIndexes[0], 0); - if (_vm->_gameConv->_restoreRunning == 1) { + if (_vm->_gameConv->restoreRunning() == 1) { _game._player._stepEnabled = false; _vm->_gameConv->run(1); _vm->_gameConv->exportValue(0); @@ -2304,8 +2304,8 @@ void Scene104::handleFinalConversation() { break; case 30: - *_vm->_gameConv->_nextStartNode = 31; - _vm->_gameConv->abortConv(); + _vm->_gameConv->setStartNode(31); + _vm->_gameConv->stop(); if (_globals[kLlanieStatus] == 2) { _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('l', 1), 0); diff --git a/engines/mads/phantom/phantom_scenes1.cpp b/engines/mads/phantom/phantom_scenes1.cpp index af22fd30569b..be800cf3b3f6 100644 --- a/engines/mads/phantom/phantom_scenes1.cpp +++ b/engines/mads/phantom/phantom_scenes1.cpp @@ -67,7 +67,7 @@ void Scene1xx::sceneEntrySound() { break; case 104: - if ((_vm->_gameConv->_restoreRunning == 7) || (_scene->_priorSceneId == 301)) { + if ((_vm->_gameConv->restoreRunning() == 7) || (_scene->_priorSceneId == 301)) { _vm->_sound->command(33); } else if (!_globals[kRoom103104Transition] && !_globals[kObservedPhan104]) { _vm->_sound->command(37); @@ -218,7 +218,7 @@ void Scene101::enter() { _talkCounter = 0; _chandelierStatus = 3; - if (_vm->_gameConv->_restoreRunning == 1) { + if (_vm->_gameConv->restoreRunning() == 1) { _vm->_gameConv->run(1); _vm->_gameConv->exportPointer(&_globals[kPlayerScore]); _chandelierStatus = 4; @@ -1118,7 +1118,7 @@ void Scene103::enter() { _anim3ActvFl = true; _game._player._stepEnabled = true; _scene->setAnimFrame(_globals._animationIndexes[3], 36); - } else if (_vm->_gameConv->_restoreRunning == 12) { + } else if (_vm->_gameConv->restoreRunning() == 12) { _vm->_gameConv->run(12); _vm->_gameConv->exportPointer(&_globals[kPlayerScore]); _vm->_gameConv->exportValue(_globals[kMusicSelected]); @@ -2504,7 +2504,7 @@ void Scene104::enter() { } if (_scene->_priorSceneId == RETURNING_FROM_LOADING) { - if (_vm->_gameConv->_restoreRunning == 7) { + if (_vm->_gameConv->restoreRunning() == 7) { _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('r', 1), 1); _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('d', 1), 1); _walkStatus = 0; @@ -7056,7 +7056,7 @@ void Scene112::enter() { _scene->setAnimFrame(_globals._animationIndexes[1], 82); _raoulAction = 2; - if (_vm->_gameConv->_restoreRunning == 3) { + if (_vm->_gameConv->restoreRunning() == 3) { _vm->_gameConv->run(3); _vm->_gameConv->exportPointer(&_globals[kPlayerScore]); _scene->setAnimFrame(_globals._animationIndexes[1], 17); @@ -7983,7 +7983,7 @@ void Scene113::enter() { _game._player._facing = FACING_NORTH; } - switch (_vm->_gameConv->_restoreRunning) { + switch (_vm->_gameConv->restoreRunning()) { case 4: _vm->_gameConv->run(4); _vm->_gameConv->exportPointer(&_globals[kPlayerScore]); diff --git a/engines/mads/phantom/phantom_scenes2.cpp b/engines/mads/phantom/phantom_scenes2.cpp index a1c73f2c5d3c..8789553962e0 100644 --- a/engines/mads/phantom/phantom_scenes2.cpp +++ b/engines/mads/phantom/phantom_scenes2.cpp @@ -128,7 +128,7 @@ void Scene201::enter() { _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14); } - if (_vm->_gameConv->_restoreRunning == 16) { + if (_vm->_gameConv->restoreRunning() == 16) { _game._player._playerPos = Common::Point(72, 101); _game._player._facing = FACING_NORTHWEST; _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('r', 1), 0); @@ -674,7 +674,7 @@ void Scene202::enter() { _degasStatus = 4; } - if (_vm->_gameConv->_restoreRunning == 17) { + if (_vm->_gameConv->restoreRunning() == 17) { _vm->_gameConv->run(17); _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET)); _vm->_gameConv->exportValue(0); @@ -683,7 +683,7 @@ void Scene202::enter() { _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4); } - if (_vm->_gameConv->_restoreRunning == 9) { + if (_vm->_gameConv->restoreRunning() == 9) { _vm->_gameConv->run(9); _vm->_gameConv->exportPointer(&_globals[kPlayerScore]); _game._player._playerPos = Common::Point(400, 141); @@ -1588,7 +1588,7 @@ void Scene203::enter() { _scene->_hotspots.activate(NOUN_MANAGERS_CHAIR, true); } - if ((_scene->_priorSceneId == RETURNING_FROM_LOADING) && (_vm->_gameConv->_restoreRunning == 5)) { + if ((_scene->_priorSceneId == RETURNING_FROM_LOADING) && (_vm->_gameConv->restoreRunning() == 5)) { _brieStatus = 4; _raoulStatus = 0; _anim1ActvFl = true; @@ -1625,7 +1625,7 @@ void Scene203::enter() { _scene->_hotspots.activate(NOUN_MANAGERS_CHAIR, true); } - if ((_scene->_priorSceneId == RETURNING_FROM_LOADING) && (_vm->_gameConv->_restoreRunning == 8)) { + if ((_scene->_priorSceneId == RETURNING_FROM_LOADING) && (_vm->_gameConv->restoreRunning() == 8)) { _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('c', 1), 0); _scene->setAnimFrame(_globals._animationIndexes[1], 9); _anim1ActvFl = true; @@ -1652,7 +1652,7 @@ void Scene203::enter() { _scene->_hotspots.activate(NOUN_DESK_LAMP, false); } - if (_vm->_gameConv->_restoreRunning == 15) { + if (_vm->_gameConv->restoreRunning() == 15) { _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -1); _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14); _game._player._playerPos = Common::Point(98, 137); @@ -4321,7 +4321,7 @@ void Scene205::enter() { } if (_scene->_priorSceneId == RETURNING_FROM_LOADING) { - if (_vm->_gameConv->_restoreRunning == 10) { + if (_vm->_gameConv->restoreRunning() == 10) { int count = 0; if (_game._objects.isInInventory(OBJ_RED_FRAME)) @@ -4349,7 +4349,7 @@ void Scene205::enter() { _scene->setAnimFrame(_globals._animationIndexes[1], 66); else _giryStatus = 2; - } else if (_vm->_gameConv->_restoreRunning == 11) { + } else if (_vm->_gameConv->restoreRunning() == 11) { _vm->_gameConv->run(11); _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET)); _vm->_gameConv->exportValue(0); @@ -4372,7 +4372,7 @@ void Scene205::enter() { _richardStatus = 3; _scene->_hotspots.activate(NOUN_MONSIEUR_RICHARD, true); - if (_vm->_gameConv->_restoreRunning == 18) { + if (_vm->_gameConv->restoreRunning() == 18) { _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4); _richardStatus = 3; _vm->_gameConv->run(18); diff --git a/engines/mads/phantom/phantom_scenes5.cpp b/engines/mads/phantom/phantom_scenes5.cpp index d738504b828a..12d064becbbc 100644 --- a/engines/mads/phantom/phantom_scenes5.cpp +++ b/engines/mads/phantom/phantom_scenes5.cpp @@ -43,7 +43,7 @@ void Scene5xx::sceneEntrySound() { if ((_globals[kCoffinStatus] == 2) && !_game._visitedScenes.exists(506) && (_globals[kFightStatus] == 0) && (_scene->_currentSceneId == 504)) _vm->_sound->command(33); else if (_scene->_currentSceneId == 505) - _vm->_sound->command((_vm->_gameConv->_restoreRunning == 20) ? 39 : 16); + _vm->_sound->command((_vm->_gameConv->restoreRunning() == 20) ? 39 : 16); else _vm->_sound->command(16); } @@ -403,7 +403,7 @@ void Scene501::actions() { break; case 68: - _vm->_gameConv->abortConv(); + _vm->_gameConv->stop(); _scene->_nextSceneId = 506; break; } @@ -1987,7 +1987,7 @@ void Scene504::enter() { _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14); } - if (_vm->_gameConv->_restoreRunning == 19) { + if (_vm->_gameConv->restoreRunning() == 19) { _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100); _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14); @@ -2002,7 +2002,7 @@ void Scene504::enter() { _scene->setAnimFrame(_globals._animationIndexes[0], 8); _vm->_gameConv->run(19); _vm->_gameConv->exportValue(_game._difficulty); - } else if (_vm->_gameConv->_restoreRunning == 27) { + } else if (_vm->_gameConv->restoreRunning() == 27) { _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100); _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14); @@ -2054,7 +2054,7 @@ void Scene504::enter() { _game._player._visible = false; _anim3ActvFl = true; - if (_vm->_gameConv->_restoreRunning == 21) { + if (_vm->_gameConv->restoreRunning() == 21) { _game._player._stepEnabled = false; _vm->_gameConv->run(21); _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_MUSIC_SCORE)); @@ -2361,7 +2361,7 @@ void Scene504::actions() { if (_action.isAction(VERB_WALK_THROUGH, NOUN_RIGHT_DOOR) || _action.isAction(VERB_OPEN, NOUN_RIGHT_DOOR)) { if (_globals[kRightDoorIsOpen504]) { if (_vm->_gameConv->activeConvId() == 26) - _vm->_gameConv->abortConv(); + _vm->_gameConv->stop(); _scene->_nextSceneId = 505; } else @@ -3043,43 +3043,43 @@ void Scene504::handleListenConversation() { void Scene504::handlePlayConversation() { switch (_action._activeAction._verbId) { case 2: - *_vm->_gameConv->_nextStartNode = 1; - _vm->_gameConv->abortConv(); + _vm->_gameConv->setStartNode(1); + _vm->_gameConv->stop(); _playStatus = 1; _songNum = 1; break; case 3: - *_vm->_gameConv->_nextStartNode = 1; - _vm->_gameConv->abortConv(); + _vm->_gameConv->setStartNode(1); + _vm->_gameConv->stop(); _playStatus = 1; _songNum = 2; break; case 4: - *_vm->_gameConv->_nextStartNode = 1; - _vm->_gameConv->abortConv(); + _vm->_gameConv->setStartNode(1); + _vm->_gameConv->stop(); _playStatus = 1; _songNum = 3; break; case 5: - *_vm->_gameConv->_nextStartNode = 1; - _vm->_gameConv->abortConv(); + _vm->_gameConv->setStartNode(1); + _vm->_gameConv->stop(); _playStatus = 1; _songNum = 4; break; case 6: - *_vm->_gameConv->_nextStartNode = 1; - _vm->_gameConv->abortConv(); + _vm->_gameConv->setStartNode(1); + _vm->_gameConv->stop(); _playStatus = 1; _songNum = 5; break; case 8: - *_vm->_gameConv->_nextStartNode = 1; - _vm->_gameConv->abortConv(); + _vm->_gameConv->setStartNode(1); + _vm->_gameConv->stop(); _playStatus = 1; break; @@ -3201,7 +3201,7 @@ void Scene505::enter() { _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('a', 4)); if (_scene->_priorSceneId == RETURNING_FROM_LOADING) { - if (_vm->_gameConv->_restoreRunning == 20) { + if (_vm->_gameConv->restoreRunning() == 20) { _scene->_hotspots.activate(NOUN_LID, false); _scene->_hotspots.activateAtPos(NOUN_LID, true, Common::Point(216, 44)); _globals._sequenceIndexes[7] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[7], false, 12); @@ -4193,7 +4193,7 @@ void Scene506::actions() { break; case 90: - _vm->_gameConv->abortConv(); + _vm->_gameConv->stop(); _scene->_nextSceneId = 504; break;