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
27namespace 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;
48};
49
50typedef int32(*opcodeTypeFunction)();
51typedef int16(*opcodeFunction)();
52
53extern uint8 *_systemFNT;
54extern int16 fontFileIndex;
55
56extern uint8 itemColor;
57extern uint8 selectColor;
58extern uint8 titleColor;
59extern uint8 subColor;
60
61extern int16 scroll;
62extern int16 switchPal;
63extern char cmdLine[90];
64
65extern int16 masterScreen;
66extern int16 doFade;
67extern int16 fadeFlag;
68
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
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
105struct 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
132 int16 frameNum;
133 uint16 frequency;
134 int16 volume;
135};
136
137/*
138struct systemStringsStruct {
139 int8 param;
140 char string[12];
141 char bootScriptName[8];
142};
143*/
144extern preloadStruct preloadData[64];
145
146extern volumeDataStruct volumeData[20];
147
148extern int32 volumeDataLoaded;
149
150extern int16 numOfDisks;
151
152extern char lastOverlay[38];
153extern char nextOverlay[38];
154
155extern int16 currentActiveMenu;
156extern int16 autoMsg;
157extern menuElementSubStruct* linkedRelation;
158extern bool userWait;
159extern int16 autoTrack;
160
161extern int16 currentDiskNumber;
162
163extern int16 volumeNumEntry;
164extern fileEntry *volumePtrToFileDescriptor;
165
166extern uint32 volumeFileDescriptorSize;
167extern int16 volumeSizeOfEntry;
168extern int16 volumeNumberOfEntry;
169
170extern int16 displayOn;
171
172extern int16 protectionCode;
173
174#define NUM_FILE_ENTRIES 257
175
176extern int16 globalVars[2000];
177extern dataFileEntry filesDatabase[NUM_FILE_ENTRIES];
178
179extern int16 bootOverlayNumber;
180
181extern SoundEntry soundList[4];
182
183extern opcodeTypeFunction opcodeTypeTable[64];
184
185extern int16 positionInStack;
186extern actorStruct actorHead;
187
188extern int16 stateID;
189extern int16 xdial;
190
191extern uint8 *currentData3DataPtr;
192extern uint8 *scriptDataPtrTable[7];
193
194extern int16 currentScriptOpcodeType;
195
196extern int16 saveOpcodeVar;
197
198extern int16 narratorOvl;
199extern int16 narratorIdx;
200
201extern int16 songLoaded;
202extern int16 songPlayed;
203extern int16 songLoop;
204extern int16 activeMouse;
205extern int16 userEnabled;
206extern int16 var5;
207extern int16 dialogueEnabled;
208extern int16 dialogueOvl;
209extern int16 dialogueObj;
210extern int16 userDelay;
211extern int16 sysKey;
212extern int16 sysX;
213extern int16 sysY;
214extern int16 automoveInc;
215extern int16 automoveMax;
216extern int16 isMessage;
217extern int16 automaticMode;
218extern int16 aniX;
219extern int16 aniY;
220extern bool animationStart;
221
222extern int16 autoOvl;
223extern int16 var39;
224extern int16 playerMenuEnabled;
225extern int16 var39;
226extern int16 var41;
227extern int16 var42;
228extern int16 var45;
229extern int16 var46;
230extern int16 var47;
231extern int16 var48;
232extern int16 flagCt;
233
234extern uint8 newPal[NBCOLORS*3];
235extern uint8 workpal[NBCOLORS*3];
236extern uint8 palScreen[NBSCREENS][NBCOLORS*3];
237
238//extern systemStringsStruct systemStrings;
239
240extern char currentCtpName[40];
241
242extern int16 saveVar1;
243extern uint8 saveVar2[97]; // recheck size
244
245extern int16 numberOfWalkboxes; // saveVar3
246extern int16 walkboxColor[15]; // saveVar4 // Type: 0x00 - non walkable, 0x01 - walkable, 0x02 - exit zone
247extern 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
249extern uint8 lastAni[16];
250
251extern int32 loadFileVar1;
252
253extern int16 loadCtFromSave;
254extern int16 ctp_routeCoordCount; // ctpVar2 // number of path-finding coordinates
255extern 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
263extern 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*/
275extern int16 ctp_walkboxTable[15][40]; // ctpVar5 // walkboxes coordinates and lines
276extern int16 walkboxColorIndex[16];
277extern int16 walkboxZoom[15]; // ctpVar7 // scaling information for walkboxes
278extern int16 distanceTable[20][10];
279
280extern int16 flagSpeed;
281extern int16 speedGame;
282extern int16 oldSpeedGame;
283
284extern uint8 globalScreen[320 * 200];
285
286//extern OSystem *osystem;
287
288} // End of namespace Cruise
289
290#endif
Definition: actor.h:25
Definition: vars.h:131
Definition: actor.h:40
Definition: vars.h:123
Definition: vars.h:113
Definition: vars.h:84
Definition: vars.h:105
Definition: vars.h:79
Definition: object.h:29
Definition: vars.h:38
Definition: vars.h:32
Definition: vars.h:69
Definition: vars.h:88
Definition: vars.h:98