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;
153  byte flags;
154  int16 x, y;
155  int16 width, height;
156  int16 textColumn, textRow;
157  int16 scrollY;
158  uint16 textColumnOffset, textLength, textMaxLength;
159  uint8 fillColor, textColor;
160  IconBlock *iconPtr;
161  WindowBlock() { memset(this, 0, sizeof(*this)); }
162  ~WindowBlock() { free (iconPtr); }
163 };
164 // note on text offset:
165 // the actual x-coordinate is: textColumn * 8 + textColumnOffset
166 // the actual y-coordinate is: textRow * 8
167 
168 enum {
169  SUBROUTINE_LINE_SMALL_SIZE = 2,
170  SUBROUTINE_LINE_BIG_SIZE = 8
171 };
172 
173 #include "common/pack-start.h"
174 
175 struct Subroutine {
176  uint16 id; /* subroutine ID */
177  uint16 first; /* offset from subroutine start to first subroutine line */
178  Subroutine *next; /* next subroutine in linked list */
179 };
180 
182  uint16 next;
183  int16 verb;
184  int16 noun1;
185  int16 noun2;
186 };
187 
188 #include "common/pack-end.h"
189 
190 struct TimeEvent {
191  uint32 time;
192  uint16 subroutine_id;
193  TimeEvent *next;
194 };
195 
197  const char *base_filename;
198  const char *restore_filename;
199  const char *tbl_filename;
200  const char *effects_filename;
201  const char *speech_filename;
202 };
203 
204 enum BoxFlags {
205  kBFToggleBox = 0x1, // Elvira 1/2
206  kBFTextBox = 0x1, // Others
207  kBFBoxSelected = 0x2,
208  kBFInvertSelect = 0x4, // Elvira 1/2
209  kBFNoTouchName = 0x4, // Others
210  kBFInvertTouch = 0x8,
211  kBFHyperBox = 0x10, // Feeble Files
212  kBFDragBox = 0x10, // Others
213  kBFBoxInUse = 0x20,
214  kBFBoxDead = 0x40,
215  kBFBoxItem = 0x80
216 };
217 
218 enum OldBoxFlags_PN {
219  kOBFObject = 0x1,
220  kOBFExit = 0x2,
221  kOBFDraggable = 0x4,
222  kOBFUseEmptyLine = 0x8,
223  kOBFBoxDisabled = 0x10,
224  kOBFInventoryBox = 0x20,
225  kOBFRoomBox = 0x40,
226  kOBFMoreBox = 0x80,
227  kOBFNoShowName = 0x100,
228  kOBFUseMessageList = 0x400,
229  // ScummVM specific
230  kOBFBoxSelected = 0x800,
231  kOBFInvertTouch = 0x1000
232 };
233 
234 enum SubObjectFlags {
235  kOFText = 0x1,
236  kOFSize = 0x2,
237  kOFWorn = 0x4, // Elvira 1
238  kOFWeight = 0x4, // Others
239  kOFVolume = 0x8,
240  kOFIcon = 0x10,
241  kOFKeyColor1 = 0x20,
242  kOFKeyColor2 = 0x40,
243  kOFMenu = 0x80,
244  kOFNumber = 0x100,
245  kOFSoft = 0x200, // Waxworks
246  kOFVoice = 0x200 // Others
247 };
248 
249 } // End of namespace AGOS
250 
251 #endif
Definition: intern.h:99
Definition: intern.h:83
Definition: intern.h:124
Definition: intern.h:181
Definition: intern.h:116
Definition: intern.h:190
Definition: intern.h:175
Definition: intern.h:48
Definition: agos.h:63
Definition: intern.h:88
Definition: intern.h:143
Definition: intern.h:138
Definition: intern.h:151
Definition: intern.h:73
Definition: intern.h:196
Definition: intern.h:105
Definition: intern.h:94
Definition: intern.h:57
Definition: intern.h:65
Definition: intern.h:43