ScummVM API documentation
vars.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 CRUISE_VARS_H
23 #define CRUISE_VARS_H
24 
25 #include "common/file.h"
26 
27 namespace Cruise {
28 
29 #define NBCOLORS 256
30 #define NBSCREENS 8
31 
33  struct menuElementSubStruct *pNext;
34  int16 ovlIdx;
35  int16 header;
36 };
37 
39  struct menuElementStruct *next;
40  const char *string;
41  int x;
42  int y;
43  int varA;
44  bool selected;
45  unsigned char color;
46  gfxEntryStruct *gfx;
47  menuElementSubStruct *ptrSub;
48 };
49 
50 typedef int32(*opcodeTypeFunction)();
51 typedef int16(*opcodeFunction)();
52 
53 extern uint8 *_systemFNT;
54 extern int16 fontFileIndex;
55 
56 extern uint8 itemColor;
57 extern uint8 selectColor;
58 extern uint8 titleColor;
59 extern uint8 subColor;
60 
61 extern int16 scroll;
62 extern int16 switchPal;
63 extern char cmdLine[90];
64 
65 extern int16 masterScreen;
66 extern int16 doFade;
67 extern int16 fadeFlag;
68 
69 struct preloadStruct {
70  char name[15];
71  int32 size;
72  int32 sourceSize;
73  uint8 *ptr;
74  int16 nofree;
75  int16 protect;
76  int16 ovl;
77 };
78 
80  int16 field_0;
81  int16 field_2;
82 };
83 
84 struct dataFileName {
85  char name[13];
86 };
87 
89  int32 offset; // offset ptr
90  int16 width;
91  int16 height;
92  int16 type; // resource type, ie. sprites 0,1,4,5 and 8
93  int16 transparency;
94  int16 hotspotY;
95  int16 hotspotX;
96 };
97 
99  char ident[10];
100  dataFileName *ptr;
101  int16 diskNumber;
102  int32 size;
103 };
104 
105 struct fileEntry {
106  char name[14];
107  int32 offset;
108  int32 size;
109  int32 extSize;
110  int32 unk3; // unused
111 };
112 
114  uint8 *ptr;
115  int16 index; // sprite index
116  char name[13];
117  int16 transparency; // sprite transparency
118  uint8 *ptrMask;
119  uint8 resourceType; // sprite and image type 2,4,8 , fnt = 7, spl = 6
120  int16 compression;
121 };
122 
124  uint16 widthInColumn;
125  uint16 width;
126  uint16 resType;
127  uint16 height;
128  dataFileEntrySub subData;
129 };
130 
131 struct SoundEntry {
132  int16 frameNum;
133  uint16 frequency;
134  int16 volume;
135 };
136 
137 /*
138 struct systemStringsStruct {
139  int8 param;
140  char string[12];
141  char bootScriptName[8];
142 };
143 */
144 extern preloadStruct preloadData[64];
145 
146 extern volumeDataStruct volumeData[20];
147 
148 extern int32 volumeDataLoaded;
149 
150 extern int16 numOfDisks;
151 
152 extern char lastOverlay[38];
153 extern char nextOverlay[38];
154 
155 extern int16 currentActiveMenu;
156 extern int16 autoMsg;
157 extern menuElementSubStruct* linkedRelation;
158 extern bool userWait;
159 extern int16 autoTrack;
160 
161 extern int16 currentDiskNumber;
162 
163 extern int16 volumeNumEntry;
164 extern fileEntry *volumePtrToFileDescriptor;
165 
166 extern uint32 volumeFileDescriptorSize;
167 extern int16 volumeSizeOfEntry;
168 extern int16 volumeNumberOfEntry;
169 
170 extern int16 displayOn;
171 
172 extern int16 protectionCode;
173 
174 #define NUM_FILE_ENTRIES 257
175 
176 extern int16 globalVars[2000];
177 extern dataFileEntry filesDatabase[NUM_FILE_ENTRIES];
178 
179 extern int16 bootOverlayNumber;
180 
181 extern SoundEntry soundList[4];
182 
183 extern opcodeTypeFunction opcodeTypeTable[64];
184 
185 extern int16 positionInStack;
186 extern actorStruct actorHead;
187 
188 extern int16 stateID;
189 extern int16 xdial;
190 
191 extern uint8 *currentData3DataPtr;
192 extern uint8 *scriptDataPtrTable[7];
193 
194 extern int16 currentScriptOpcodeType;
195 
196 extern int16 saveOpcodeVar;
197 
198 extern int16 narratorOvl;
199 extern int16 narratorIdx;
200 
201 extern int16 songLoaded;
202 extern int16 songPlayed;
203 extern int16 songLoop;
204 extern int16 activeMouse;
205 extern int16 userEnabled;
206 extern int16 var5;
207 extern int16 dialogueEnabled;
208 extern int16 dialogueOvl;
209 extern int16 dialogueObj;
210 extern int16 userDelay;
211 extern int16 sysKey;
212 extern int16 sysX;
213 extern int16 sysY;
214 extern int16 automoveInc;
215 extern int16 automoveMax;
216 extern int16 isMessage;
217 extern int16 automaticMode;
218 extern int16 aniX;
219 extern int16 aniY;
220 extern bool animationStart;
221 
222 extern int16 autoOvl;
223 extern int16 var39;
224 extern int16 playerMenuEnabled;
225 extern int16 var39;
226 extern int16 var41;
227 extern int16 var42;
228 extern int16 var45;
229 extern int16 var46;
230 extern int16 var47;
231 extern int16 var48;
232 extern int16 flagCt;
233 
234 extern uint8 newPal[NBCOLORS*3];
235 extern uint8 workpal[NBCOLORS*3];
236 extern uint8 palScreen[NBSCREENS][NBCOLORS*3];
237 
238 //extern systemStringsStruct systemStrings;
239 
240 extern char currentCtpName[40];
241 
242 extern int16 saveVar1;
243 extern uint8 saveVar2[97]; // recheck size
244 
245 extern int16 numberOfWalkboxes; // saveVar3
246 extern int16 walkboxColor[15]; // saveVar4 // Type: 0x00 - non walkable, 0x01 - walkable, 0x02 - exit zone
247 extern int16 walkboxState[15]; // saveVar5 // walkbox can change its type: 0x00 - not changeable, 0x01 - changeable
248 // Assumption: To change the type: walkboxColor[i] -= walkboxChane[i] and vice versa
249 extern uint8 lastAni[16];
250 
251 extern int32 loadFileVar1;
252 
253 extern int16 loadCtFromSave;
254 extern int16 ctp_routeCoordCount; // ctpVar2 // number of path-finding coordinates
255 extern int16 ctp_routeCoords[20][2]; // ctpVar3 // path-finding coordinates array
256 
257 /* ctp_routeCoords:
258 
259  correct size would be: ctp_routes[routeCoordCount * 4]
260  coordinate information with x (2 bytes) and y (2 bytes)
261 */
262 
263 extern int16 ctp_routes[20][10]; // path-finding line information
264 
265 /* ctp_routes:
266 
267  correct size would be: ctp_routes[routeCoordCount * 20 * 2]
268  array is separate in 20 * 2 bytes slices.
269  first 2 bytes of the slice indicate how many coordinates/lines are following (lineCount)
270  after that there are lineCount * 2 bytes following with indexes pointing on the routeCoords table
271  the root x,y for the lines is the coordinate in the routeCoords array, which fits to the current slice
272  for the 20 * i slice the root x,y is routeCoords[i], routeCoords[i+2]
273  the unused rest of the slice if filled up with 0xFF
274 */
275 extern int16 ctp_walkboxTable[15][40]; // ctpVar5 // walkboxes coordinates and lines
276 extern int16 walkboxColorIndex[16];
277 extern int16 walkboxZoom[15]; // ctpVar7 // scaling information for walkboxes
278 extern int16 distanceTable[20][10];
279 
280 extern int16 flagSpeed;
281 extern int16 speedGame;
282 extern int16 oldSpeedGame;
283 
284 extern uint8 globalScreen[320 * 200];
285 
286 //extern OSystem *osystem;
287 
288 } // End of namespace Cruise
289 
290 #endif
Definition: vars.h:38
Definition: vars.h:131
Definition: vars.h:113
Definition: vars.h:105
Definition: vars.h:123
Definition: vars.h:79
Definition: vars.h:32
Definition: actor.h:25
Definition: vars.h:69
Definition: vars.h:98
Definition: object.h:29
Definition: actor.h:40
Definition: vars.h:84
Definition: vars.h:88