aboutsummaryrefslogtreecommitdiff
path: root/engines/m4/converse.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2010-03-07 05:06:58 +0000
committerPaul Gilbert2010-03-07 05:06:58 +0000
commit7f57001e175ef2215e192968e9883e63145e7a50 (patch)
tree99a4fd17e2a9717d0763f2a19065b2c2056f59d6 /engines/m4/converse.cpp
parenta5a8b6c19f2601113fc3d3a14b6ec19576fdd1f8 (diff)
downloadscummvm-rg350-7f57001e175ef2215e192968e9883e63145e7a50.tar.gz
scummvm-rg350-7f57001e175ef2215e192968e9883e63145e7a50.tar.bz2
scummvm-rg350-7f57001e175ef2215e192968e9883e63145e7a50.zip
Split up the scene.cpp file into separate files for M4 and MADS specific scene code and support classes. Also have started adding code for textual display and proper current action display
svn-id: r48172
Diffstat (limited to 'engines/m4/converse.cpp')
-rw-r--r--engines/m4/converse.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp
index 18d61ef7ce..746ced5d11 100644
--- a/engines/m4/converse.cpp
+++ b/engines/m4/converse.cpp
@@ -103,7 +103,7 @@ void ConversationView::setNode(int32 nodeIndex) {
_activeItems.clear();
if (nodeIndex != -1) {
- ConvEntry *node = _vm->_converse->getNode(nodeIndex);
+ ConvEntry *node = _m4Vm->_converse->getNode(nodeIndex);
for (uint i = 0; i < node->entries.size(); ++i) {
if (!node->entries[i]->visible)
@@ -137,7 +137,7 @@ void ConversationView::setNode(int32 nodeIndex) {
//printf("Current node falls through node at offset %i when entries are less or equal than %i\n",
// node->fallthroughOffset, node->fallthroughMinEntries);
if (_activeItems.size() <= (uint32)node->fallthroughMinEntries) {
- const EntryInfo *entryInfo = _vm->_converse->getEntryInfo(node->fallthroughOffset);
+ const EntryInfo *entryInfo = _m4Vm->_converse->getEntryInfo(node->fallthroughOffset);
//printf("Entries are less than or equal to %i, falling through to node at offset %i, index %i\n",
// node->fallthroughMinEntries, node->fallthroughOffset, entryInfo->nodeIndex);
setNode(entryInfo->nodeIndex);
@@ -228,7 +228,7 @@ void ConversationView::selectEntry(int entryIndex) {
// Hide selected entry, unless it has a persistent flag set
if (!(_activeItems[entryIndex]->flags & kEntryPersists)) {
//printf("Hiding selected entry\n");
- _vm->_converse->getNode(_currentNodeIndex)->entries[entryIndex]->visible = false;
+ _m4Vm->_converse->getNode(_currentNodeIndex)->entries[entryIndex]->visible = false;
} else {
//printf("Selected entry is persistent, not hiding it\n");
}
@@ -266,8 +266,8 @@ void ConversationView::playNextReply() {
ConvEntry *currentEntry = _activeItems[_highlightedIndex]->entries[i];
if (currentEntry->isConditional) {
- if (!_vm->_converse->evaluateCondition(
- _vm->_converse->getValue(currentEntry->condition.offset),
+ if (!_m4Vm->_converse->evaluateCondition(
+ _m4Vm->_converse->getValue(currentEntry->condition.offset),
currentEntry->condition.op, currentEntry->condition.val))
continue; // don't play this reply
}
@@ -315,7 +315,7 @@ void ConversationView::playNextReply() {
//printf("Current selection does %i actions\n", _activeItems[entryIndex]->actions.size());
for (uint32 i = 0; i < _activeItems[_highlightedIndex]->actions.size(); i++) {
- if (!_vm->_converse->performAction(_activeItems[_highlightedIndex]->actions[i]))
+ if (!_m4Vm->_converse->performAction(_activeItems[_highlightedIndex]->actions[i]))
break;
} // end for
@@ -1220,4 +1220,14 @@ bool Converse::performAction(EntryAction *action) {
} // end switch
}
+/*--------------------------------------------------------------------------*/
+
+MadsConversation::MadsConversation() {
+ for (int i = 0; i < MADS_TALK_SIZE; ++i) {
+ _talkList[i].desc = NULL;
+ _talkList[i].id = 0;
+ }
+}
+
+
} // End of namespace M4