From 6e0d6e36a921972305e458fe9194548efc50dead Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 8 Jan 2016 18:46:04 +1100 Subject: MADS: Further conversation cleanup, start of conv CND file loading --- engines/mads/conversations.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'engines/mads/conversations.cpp') 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 -- cgit v1.2.3