ScummVM API documentation
script_support.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TITANIC_SCRIPT_SUPPORT_H
23 #define TITANIC_SCRIPT_SUPPORT_H
24 
25 #include "titanic/support/simple_file.h"
26 
27 namespace Titanic {
28 
29 #define DIALS_ARRAY_COUNT 10
30 
31 enum ScriptArrayFlag { SF_NONE = 0, SF_RANDOM = 1, SF_SEQUENTIAL = 2 };
32 
34  uint _roomNum;
35  uint _dialogueId;
36 };
37 
39  uint _tag;
40  uint _values[4];
41 
42  TTnpcScriptResponse() : _tag(0) {
43  _values[0] = _values[1] = _values[2] = _values[3] = 0;
44  }
45 
49  int size() const;
50 };
51 
52 struct TTscriptRange {
53  uint _id;
54  Common::Array<uint> _values;
55  TTscriptRange *_nextP;
56  uint _priorIndex;
57  ScriptArrayFlag _mode;
58 
59  TTscriptRange() : _id(0), _nextP(nullptr),
60  _priorIndex(0), _mode(SF_NONE) {}
61  TTscriptRange(uint id, const Common::Array<uint> &values, bool isRandom,
62  bool isSequential);
63 };
64 
66  int _field0;
67  int _category;
68  CString _string8;
69  int _fieldC;
70  CString _string10;
71  CString _string14;
72  CString _string18;
73  CString _string1C;
74  int _field20;
75  CString _string24;
76  int _field28;
77  int _field2C;
78  int _field30;
79 
80  TTsentenceEntry() : _field0(0), _category(0), _fieldC(0),
81  _field20(0), _field28(0), _field2C(0), _field30(0) {}
82 
87  bool load(Common::SeekableReadStream *s);
88 };
89 
90 class TTsentenceEntries : public Common::Array<TTsentenceEntry> {
91 public:
95  void load(const CString &resName);
96 };
97 
99  uint _id;
100  uint _values[8];
101 
102  TTscriptMapping();
103 };
104 
105 class TTscriptMappings : public Common::Array<TTscriptMapping> {
106 public:
107  int _valuesPerMapping;
108 
109  void load(const char *name, int valuesPerMapping);
110 };
111 
112 struct TTtagMapping {
113  uint _src, _dest;
114  TTtagMapping() : _src(0), _dest(0) {}
115  TTtagMapping(uint src, uint dest) : _src(src), _dest(dest) {}
116 };
117 
118 class TTtagMappings : public Common::Array<TTtagMapping> {
119 public:
120  void load(const char *name);
121 };
122 
123 struct TTwordEntry {
124  uint _id;
125  CString _text;
126 
127  TTwordEntry() : _id(0) {}
128 };
129 
130 class TTwordEntries : public Common::Array<TTwordEntry> {
131 public:
132  void load(const char *name);
133 };
134 
136  uint _tag1;
137  uint _tag2;
138  uint _index;
139 
140  TThandleQuoteEntry() : _tag1(0), _tag2(0), _index(0) {}
141 };
142 
143 class TThandleQuoteEntries : public Common::Array<TThandleQuoteEntry> {
144 public:
145  uint _rangeStart, _rangeEnd;
146  uint _incr;
147 public:
148  TThandleQuoteEntries() : _rangeStart(0), _rangeEnd(0), _incr(0) {}
149  void load(const char *name);
150 };
151 
152 struct TTmapEntry {
153  uint _src;
154  uint _dest;
155 
156  TTmapEntry() : _src(0), _dest(0) {}
157 };
158 
159 class TTmapEntryArray : public Common::Array<TTmapEntry> {
160 public:
161  void load(const char *name);
162 
166  int find(uint id) const;
167 };
168 
170  uint _newId;
171  uint _newValue;
172  uint _dialBits;
173 
174  TTupdateState() : _newId(0), _newValue(0), _dialBits(0) {}
175 };
176 
177 class TTupdateStateArray : public Common::Array<TTupdateState> {
178 public:
179  void load(const char *name);
180 };
181 
183  CString _str;
184  uint _dialogueId;
185  uint _roomNum;
186  uint _val1;
187 };
188 
189 class TTcommonPhraseArray : public Common::Array<TTcommonPhrase> {
190 public:
191  void load(const char *name);
192 };
193 
194 } // End of namespace Titanic
195 
196 #endif /* TITANIC_TT_NPC_SCRIPT_H */
Definition: script_support.h:105
Definition: script_support.h:65
Definition: script_support.h:189
Definition: script_support.h:159
In find(In first, In last, const T &v)
Definition: algorithm.h:225
Definition: script_support.h:143
Definition: script_support.h:152
Definition: script_support.h:169
Definition: stream.h:745
Definition: script_support.h:90
Definition: script_support.h:177
Definition: script_support.h:98
Definition: script_support.h:112
Definition: script_support.h:135
Definition: arm.h:30
Definition: string.h:40
Definition: script_support.h:118
Definition: script_support.h:38
Definition: script_support.h:123
Definition: script_support.h:182
Definition: script_support.h:130
Definition: script_support.h:52
Definition: script_support.h:33