aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/conversations.h
diff options
context:
space:
mode:
authorPaul Gilbert2016-01-08 17:02:17 +1100
committerPaul Gilbert2016-01-08 17:02:17 +1100
commit162ddbea0f264a29a5972f23139d287e775050d9 (patch)
treea0524a9ecf5742d04e0873190dfd1a234b97936b /engines/mads/conversations.h
parent31d47d6be255d960d61805ea739bc02ef677136e (diff)
downloadscummvm-rg350-162ddbea0f264a29a5972f23139d287e775050d9.tar.gz
scummvm-rg350-162ddbea0f264a29a5972f23139d287e775050d9.tar.bz2
scummvm-rg350-162ddbea0f264a29a5972f23139d287e775050d9.zip
MADS: Cleanup of existing converstations skeleton code
Diffstat (limited to 'engines/mads/conversations.h')
-rw-r--r--engines/mads/conversations.h103
1 files changed, 98 insertions, 5 deletions
diff --git a/engines/mads/conversations.h b/engines/mads/conversations.h
index c4bf06e6dc..2a2a6258df 100644
--- a/engines/mads/conversations.h
+++ b/engines/mads/conversations.h
@@ -23,24 +23,110 @@
#ifndef MADS_CONVERSATIONS_H
#define MADS_CONVERSATIONS_H
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "common/str-array.h"
+
namespace MADS {
+#define MAX_CONVERSATIONS 5
+#define MAX_SPEAKERS 5
+
+enum DialogCommands {
+ cmdNodeEnd = 0,
+ //
+ cmdHide = 2,
+ cmdUnhide = 3,
+ cmdMessage = 4,
+ //
+ //
+ cmdGoto = 7,
+ //
+ cmdAssign = 9,
+ cmdDialogEnd = 255
+};
+
+struct ConvDialog {
+ int16 _textLineIndex; // 0-based
+ int16 _speechIndex; // 1-based
+ uint16 _nodeOffset; // offset in section 6
+ uint16 _nodeSize; // size in section 6
+};
+
+struct ConvNode {
+ uint16 _index;
+ uint16 _dialogCount;
+ int16 _unk1;
+ int16 _unk2;
+ int16 _unk3;
+
+ Common::Array<ConvDialog> _dialogs;
+};
+
+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 _speakerCount;
+ int _textSize;
+ int _commandsSize;
+
+ Common::String _portraits[MAX_SPEAKERS];
+ bool _speakerExists[MAX_SPEAKERS];
+ Common::String _speechFile;
+ Common::Array<uint> _messages;
+ Common::StringArray _textLines;
+ Common::Array<ConvNode> _convNodes;
+
+ /**
+ * Load the specified conversation resource file
+ */
+ void load(const Common::String &filename);
+};
+
+struct ConversationData2 {
+};
+
+struct ConversationEntry {
+ int _convId;
+ ConversationData _data;
+ ConversationData2 _data2;
+};
+
class MADSEngine;
-class GameConversation {
+class GameConversations {
private:
MADSEngine *_vm;
+ ConversationEntry _conversations[MAX_CONVERSATIONS];
+
+ /**
+ * Returns the record for the specified conversation, if it's loaded
+ */
+ ConversationEntry *getConv(int convId);
+ /**
+ * Start a specified conversation slot
+ */
+ void start();
+public:
+ ConversationEntry *_runningConv;
+ int _restoreRunning;
+ bool _playerEnabled;
+ uint32 _startFrameNumber;
public:
/**
* Constructor
*/
- GameConversation(MADSEngine *vm);
+ GameConversations(MADSEngine *vm);
/**
* Destructor
*/
- virtual ~GameConversation();
+ virtual ~GameConversations();
int* _nextStartNode;
int* getVariable(int idx);
@@ -56,9 +142,16 @@ public:
void release();
void reset(int id);
void abortConv();
+
+ /**
+ * Returns true if any conversation is currently atcive
+ */
+ bool active() const { return _runningConv != nullptr; }
- int _running;
- int _restoreRunning;
+ /**
+ * Returns the currently active conversation Id
+ */
+ int activeConvId() const { return !active() ? -1 : _runningConv->_convId; }
};
} // End of namespace MADS