diff options
author | Paul Gilbert | 2016-01-08 18:46:04 +1100 |
---|---|---|
committer | Paul Gilbert | 2016-01-08 18:46:04 +1100 |
commit | 6e0d6e36a921972305e458fe9194548efc50dead (patch) | |
tree | 9cea2866b23cd833508c186c5635bc7edab63016 /engines/mads/conversations.cpp | |
parent | f1a80f91a684cd0e1fc2898d92a1c7531c3b2d75 (diff) | |
download | scummvm-rg350-6e0d6e36a921972305e458fe9194548efc50dead.tar.gz scummvm-rg350-6e0d6e36a921972305e458fe9194548efc50dead.tar.bz2 scummvm-rg350-6e0d6e36a921972305e458fe9194548efc50dead.zip |
MADS: Further conversation cleanup, start of conv CND file loading
Diffstat (limited to 'engines/mads/conversations.cpp')
-rw-r--r-- | engines/mads/conversations.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/engines/mads/conversations.cpp b/engines/mads/conversations.cpp index 5f304860e7..0f51d96c0c 100644 --- a/engines/mads/conversations.cpp +++ b/engines/mads/conversations.cpp @@ -45,7 +45,7 @@ GameConversations::GameConversations(MADSEngine *vm) : _vm(vm) { GameConversations::~GameConversations() { } -void GameConversations::get(int id) { +void GameConversations::load(int id) { // Scan through the conversation list for a free slot int slotIndex = -1; for (int idx = 0; idx < MAX_CONVERSATIONS && slotIndex == -1; ++idx) { @@ -59,10 +59,12 @@ void GameConversations::get(int id) { _conversations[slotIndex]._convId = id; // Load the conversation data - Common::String cnvFilename = Common::String::format("CONV%03d.CNV", id); + Common::String cnvFilename = Common::String::format("CONV%03d.CNV", id); _conversations[slotIndex]._data.load(cnvFilename); - // TODO: Also handle the .CND file + // Load the conversation's CND data + Common::String cndFilename = Common::String::format("CONV%03d.CND", id); + _conversations[slotIndex]._cnd.load(cndFilename); } ConversationEntry *GameConversations::getConv(int convId) { @@ -74,7 +76,6 @@ ConversationEntry *GameConversations::getConv(int convId) { return nullptr; } - void GameConversations::run(int id) { // If another conversation is running, then stop it first if (_runningConv) @@ -150,8 +151,8 @@ void GameConversations::start() { void GameConversations::setVariable(uint idx, int v1, int v2) { if (active()) { - _runningConv->_data2._vars[idx].v1 = v1; - _runningConv->_data2._vars[idx].v2 = v2; + _runningConv->_cnd._vars[idx].v1 = v1; + _runningConv->_cnd._vars[idx].v2 = v2; } } @@ -386,4 +387,10 @@ void ConversationData::load(const Common::String &filename) { warning("TODO GameConversations::get"); } +/*------------------------------------------------------------------------*/ + +void ConversationCnd::load(const Common::String &filename) { + // TODO +} + } // End of namespace MADS |