ScummVM API documentation
intern.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 AGOS_INTERN_H
23 #define AGOS_INTERN_H
24 
25 #include "agos/intern_detection.h"
26 
27 namespace AGOS {
28 
29 enum ChildType {
30  kRoomType = 1,
31  kObjectType = 2,
32  kPlayerType = 3,
33  kGenExitType = 4, // Elvira 1 specific
34  kSuperRoomType = 4, // Elvira 2 specific
35 
36  kContainerType = 7,
37  kChainType = 8,
38  kUserFlagType = 9,
39 
40  kInheritType = 255
41 };
42 
43 struct Child {
44  Child *next;
45  uint16 type;
46 };
47 
48 struct SubRoom : Child {
49  uint16 subroutine_id;
50  uint16 roomExitStates;
51  uint16 roomExit[1];
52  uint16 roomShort;
53  uint16 roomLong;
54  uint16 flags;
55 };
56 
57 struct SubSuperRoom : Child {
58  uint16 subroutine_id;
59  uint16 roomX;
60  uint16 roomY;
61  uint16 roomZ;
62  uint16 roomExitStates[1];
63 };
64 
65 struct SubObject : Child {
66  uint16 objectName;
67  uint16 objectSize;
68  uint16 objectWeight;
69  uint32 objectFlags;
70  int16 objectFlagValue[1];
71 };
72 
73 struct SubPlayer : Child {
74  int16 userKey;
75  int16 size;
76  int16 weight;
77  int16 strength;
78  int16 flags;
79  int16 level;
80  int32 score;
81 };
82 
83 struct SubGenExit : Child {
84  uint16 subroutine_id;
85  uint16 dest[6];
86 };
87 
88 struct SubContainer : Child {
89  uint16 subroutine_id;
90  uint16 volume;
91  uint16 flags;
92 };
93 
94 struct SubChain : Child {
95  uint16 subroutine_id;
96  uint16 chChained;
97 };
98 
99 struct SubUserFlag : Child {
100  uint16 subroutine_id;
101  uint16 userFlags[8];
102  uint16 userItems[1];
103 };
104 
105 struct SubInherit : Child {
106  uint16 subroutine_id;
107  uint16 inMaster;
108 };
109 
110 enum {
111  SubRoom_SIZE = sizeof(SubRoom) - sizeof(uint16),
112  SubSuperRoom_SIZE = sizeof(SubSuperRoom) - sizeof(uint16),
113  SubObject_SIZE = sizeof(SubObject) - sizeof(int16)
114 };
115 
116 struct RoomState {
117  uint16 state;
118  uint16 classFlags;
119  uint16 roomExitStates;
120 
121  RoomState() { memset(this, 0, sizeof(*this)); }
122 };
123 
124 struct Item {
125  uint16 parent;
126  uint16 child;
127  uint16 next;
128  int16 noun;
129  int16 adjective;
130  int16 state; /* signed int */
131  uint16 classFlags;
132  uint16 itemName;
133  Child *children;
134 
135  Item() { memset(this, 0, sizeof(*this)); }
136 };
137 
138 struct IconEntry {
139  Item *item;
140  uint16 boxCode;
141 };
142 
143 struct IconBlock {
144  int16 line;
145  Item *itemRef;
146  IconEntry iconArray[64];
147  int16 upArrow, downArrow;
148  uint16 classMask;
149 };
150 
151 struct WindowBlock {
152  byte mode = 0;
153  byte flags = 0;
154  int16 x = 0, y = 0;
155  int16 width = 0, height = 0;
156  int16 textColumn = 0, textRow = 0;
157  int16 scrollY = 0;
158  uint16 textColumnOffset = 0, textLength = 0, textMaxLength = 0;
159  uint8 fillColor, textColor = 0;
160  IconBlock *iconPtr = nullptr;
161  WindowBlock() = default;
162  WindowBlock(const WindowBlock &) = delete;
163  WindowBlock(WindowBlock &&) = delete;
164  WindowBlock &operator=(const WindowBlock &) = delete;
165  WindowBlock &operator=(WindowBlock &&) = delete;
166  ~WindowBlock() { free (iconPtr); }
167 };
168 // note on text offset:
169 // the actual x-coordinate is: textColumn * 8 + textColumnOffset
170 // the actual y-coordinate is: textRow * 8
171 
172 enum {
173  SUBROUTINE_LINE_SMALL_SIZE = 2,
174  SUBROUTINE_LINE_BIG_SIZE = 8
175 };
176 
177 #include "common/pack-start.h"
178 
179 struct Subroutine {
180  uint16 id; /* subroutine ID */
181  uint16 first; /* offset from subroutine start to first subroutine line */
182  Subroutine *next; /* next subroutine in linked list */
183 };
184 
186  uint16 next;
187  int16 verb;
188  int16 noun1;
189  int16 noun2;
190 };
191 
192 #include "common/pack-end.h"
193 
194 struct TimeEvent {
195  uint32 time;
196  uint16 subroutine_id;
197  TimeEvent *next;
198 };
199 
201  const char *base_filename;
202  const char *restore_filename;
203  const char *tbl_filename;
204  const char *effects_filename;
205  const char *speech_filename;
206 };
207 
208 enum BoxFlags {
209  kBFToggleBox = 0x1, // Elvira 1/2
210  kBFTextBox = 0x1, // Others
211  kBFBoxSelected = 0x2,
212  kBFInvertSelect = 0x4, // Elvira 1/2
213  kBFNoTouchName = 0x4, // Others
214  kBFInvertTouch = 0x8,
215  kBFHyperBox = 0x10, // Feeble Files
216  kBFDragBox = 0x10, // Others
217  kBFBoxInUse = 0x20,
218  kBFBoxDead = 0x40,
219  kBFBoxItem = 0x80
220 };
221 
222 enum OldBoxFlags_PN {
223  kOBFObject = 0x1,
224  kOBFExit = 0x2,
225  kOBFDraggable = 0x4,
226  kOBFUseEmptyLine = 0x8,
227  kOBFBoxDisabled = 0x10,
228  kOBFInventoryBox = 0x20,
229  kOBFRoomBox = 0x40,
230  kOBFMoreBox = 0x80,
231  kOBFNoShowName = 0x100,
232  kOBFUseMessageList = 0x400,
233  // ScummVM specific
234  kOBFBoxSelected = 0x800,
235  kOBFInvertTouch = 0x1000
236 };
237 
238 enum SubObjectFlags {
239  kOFText = 0x1,
240  kOFSize = 0x2,
241  kOFWorn = 0x4, // Elvira 1
242  kOFWeight = 0x4, // Others
243  kOFVolume = 0x8,
244  kOFIcon = 0x10,
245  kOFKeyColor1 = 0x20,
246  kOFKeyColor2 = 0x40,
247  kOFMenu = 0x80,
248  kOFNumber = 0x100,
249  kOFSoft = 0x200, // Waxworks
250  kOFVoice = 0x200 // Others
251 };
252 
253 } // End of namespace AGOS
254 
255 #endif
Definition: intern.h:99
Definition: intern.h:83
Definition: intern.h:124
Definition: intern.h:185
Definition: intern.h:116
Definition: intern.h:194
Definition: intern.h:179
Definition: intern.h:48
Definition: agos.h:72
Definition: intern.h:88
Definition: intern.h:143
Definition: intern.h:138
Definition: intern.h:151
Definition: intern.h:73
Definition: intern.h:200
Definition: intern.h:105
Definition: intern.h:94
Definition: intern.h:57
Definition: intern.h:65
Definition: intern.h:43