aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/conversations.h
diff options
context:
space:
mode:
authorPaul Gilbert2016-01-10 06:10:03 +1100
committerPaul Gilbert2016-01-10 06:10:03 +1100
commita745010998ad81ce56abb00b06803e7ae64f91fb (patch)
tree7e6b14ebfd99bba322827d76f5e28737ee75faeb /engines/mads/conversations.h
parent2b1f7d6ebc6b272b7f91c7f89149a19fbb22f143 (diff)
downloadscummvm-rg350-a745010998ad81ce56abb00b06803e7ae64f91fb.tar.gz
scummvm-rg350-a745010998ad81ce56abb00b06803e7ae64f91fb.tar.bz2
scummvm-rg350-a745010998ad81ce56abb00b06803e7ae64f91fb.zip
MADS: Implement GameConversations::update
Diffstat (limited to 'engines/mads/conversations.h')
-rw-r--r--engines/mads/conversations.h57
1 files changed, 53 insertions, 4 deletions
diff --git a/engines/mads/conversations.h b/engines/mads/conversations.h
index e3e958ebc4..dbf000f5a5 100644
--- a/engines/mads/conversations.h
+++ b/engines/mads/conversations.h
@@ -45,7 +45,7 @@ enum ConversationMode {
CONVMODE_7 = 7,
CONVMODE_8 = 8,
CONVMODE_9 = 9,
- CONVMODE_10 = 10
+ CONVMODE_STOP = 10
};
enum DialogCommands {
@@ -69,6 +69,7 @@ enum ConvFlagMode {
};
enum ConvEntryFlag {
+ ENTRYFLAG_2 = 2,
ENTRYFLAG_4000 = 0x4000,
ENTRYFLAG_8000 = 0x8000
};
@@ -90,7 +91,7 @@ struct ConvNode {
uint16 _index;
uint16 _dialogCount;
int16 _unk1;
- int16 _unk2;
+ bool _active;
int16 _unk3;
Common::Array<ConvDialog> _dialogs;
@@ -115,7 +116,8 @@ struct ConversationData {
Common::String _speechFile;
Common::Array<uint> _messages;
Common::StringArray _textLines;
- Common::Array<ConvNode> _convNodes;
+ Common::Array<ConvNode> _nodes;
+ Common::Array<ConvDialog> _dialogs;
/**
* Load the specified conversation resource file
@@ -147,6 +149,16 @@ struct ConversationVar {
* Return either the variable's pointer, or a pointer to it's direct value
*/
int *getValue() { return _isPtr ? _valPtr : &_val; }
+
+ /**
+ * Returns true if variable is a pointer
+ */
+ bool isPtr() const { return _isPtr; }
+
+ /**
+ * Returns true if variable is numeric
+ */
+ bool isNumeric() const { return !_isPtr; }
};
/**
@@ -158,6 +170,16 @@ struct ConversationConditionals {
Common::Array<ConversationVar> _vars;
int _numImports;
+ int _currentNode;
+ int _fieldC;
+ int _fieldE;
+ int _field10;
+ int _field12;
+ int _field28;
+ int _field3C;
+ int _field50;
+ int _field64;
+
/**
* Constructor
*/
@@ -194,9 +216,10 @@ private:
int _arr5[MAX_SPEAKERS];
int _arr6[MAX_SPEAKERS];
InputMode _inputMode;
- int _val1, _val5;
+ int _val1;
ConversationMode _currentMode;
ConversationMode _priorMode;
+ int _verbId;
int _speakerVal;
int _heroTrigger;
TriggerMode _heroTriggerMode;
@@ -208,6 +231,7 @@ private:
uint32 _startFrameNumber;
ConversationVar *_vars;
ConversationVar *_nextStartNode;
+ int _currentNode;
/**
* Returns the record for the specified conversation, if it's loaded
@@ -228,6 +252,31 @@ private:
* Flags a conversation option/entry
*/
void flagEntry(ConvFlagMode mode, int entryIndex);
+
+ /**
+ * Generate a menu
+ */
+ ConversationMode generateMenu();
+
+ /**
+ * Generate text
+ */
+ void generateText(int textLineIndex, int v2, int *v3);
+
+ /**
+ * Generate message
+ */
+ void generateMessage(int textLineIndex, int v2, int *v3, int *v4);
+
+ /**
+ * Gets the next node
+ */
+ bool nextNode();
+
+ /**
+ * Executes a conversation entry
+ */
+ void executeEntry(int index);
public:
/**
* Constructor