ScummVM API documentation
types.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 #ifndef TOT_TYPES_H
22 #define TOT_TYPES_H
23 
24 #include "common/scummsys.h"
25 
26 namespace Tot {
27 
28 const int kVerbRegSize = 263;
29 const int kRoomRegSize = 10856;
30 const int kItemRegSize = 279;
31 
32 const int kList1Index = 19;
33 const int kList2Index = 20;
34 const int kList1code = 149;
35 const int kList2code = 150;
39 const int kInventoryIconCount = 34;
40 const int kNumScreenOverlays = 15;
44 const int kDepthLevelCount = 15;
48 const int kWalkFrameCount = 16;
52 const int kSecAnimationFrameCount = 50;
57 const int kXGridCount = 8;
62 const int kYGridCount = 5;
66 const int kCharacerCorrectionY = 49;
70 const int kCharacterCorrectionX = 14;
71 const int kObjectNameLength = 20;
72 const int kCharacterCount = 9;
76 const int kInventoryIconSize = 1018;
80 const int kRoutePointCount = 7;
81 
85 typedef Common::Point Route[kRoutePointCount];
86 
87 
88 enum TRAJECTORIES_OP {
89  // Subtracts the animation dimensions to the trajectory coordinates to adjust movement
90  SET_WITH_ANIM = false,
91  // Adds the animation dimensions to the trajectory coordinates to restore
92  RESTORE = true
93 };
94 
95 struct ObjectInfo {
96  uint16 code, posx, posy, posx2, posy2;
97 };
98 
99 struct CharacterAnim {
100  uint16 depth;
101  byte *bitmap[4][kWalkFrameCount + 30]; // 30 = 3 actions * 10 frames each
102 };
103 
105  uint16 depth, dir, posx, posy;
106  byte *bitmap[4][kSecAnimationFrameCount];
107 };
108 
110  uint16 bitmapIndex = -1;
111  uint16 code = -1;
112  Common::String objectName = "";
113 };
114 
118 struct TextEntry {
119  Common::String text; // string
120  bool continued = false; // true if the next entry is a continuation of this one
121  uint16 response = 0; // entry number of reply
122  int32 pointer = 0;
123 };
124 
125 struct ScreenObject {
129  uint16 code;
130  byte height; /* 0 top 1 middle 2 bottom, determines character anim on use/pick*/
131  Common::String name; /* name for mouseover*/
132  uint16 lookAtTextRef; /* Text reference when looking at object */
133  uint16 beforeUseTextRef; /* Text reference before using object */
134  uint16 afterUseTextRef; /* Text reference after using object */
135  uint16 pickTextRef; /* Text reference when picking up object */
136  uint16 useTextRef; /* Text reference when using object */
137  byte speaking; /* whether the object talks or not */
138  bool openable; /* true if it can be opened */
139  bool closeable; /* true if it can be closed*/
140  byte used[8]; /* flags (one per original savegame) on whether the object has been used */
141  bool pickupable;
142  uint16 useWith,
143  replaceWith; /* Code of the object it should be replaced with in case a replacement is due.*/
144  byte depth;
145  uint32 bitmapPointer; /* reference to the objects bitmap in the bitmap resource file */
146  uint16 bitmapSize;
147  uint32 rotatingObjectAnimation; /* Pointer to the FLC animation of the rotatin object */
148  uint16 rotatingObjectPalette; /* Pointer to the palette of the above FLC animation*/
149  uint16 dropOverlayX, dropOverlayY; /* coords when the object requires placing an overlay on the screen */
150  uint32 dropOverlay; /* pointer to such overlay */
151  uint16 dropOverlaySize;
152  uint16 objectIconBitmap; /* Icon on the inventory */
153 
154  byte xgrid1, ygrid1, xgrid2, ygrid2; /* position of patches below*/
155 
156  byte walkAreasPatch[10][10]; /* patch on the scene's walking area (e.g. object prevents character from walking */
157  byte mouseGridPatch[10][10]; /* patch on the mouse grid area (i.e. selectable area of the object */
158 };
159 
160 struct DoorRegistry {
161  uint16 nextScene,
162  exitPosX,
163  exitPosY;
164  byte openclosed,
165  doorcode;
166 };
167 
169  uint16 fileIndex;
170  Common::String objectName;
171 };
172 
174  uint32 bitmapPointer;
175  uint16 bitmapSize;
176  uint16 coordx, coordy, depth;
177 };
178 
180  uint16 code;
181  uint32 roomImagePointer;
182  uint16 roomImageSize;
183  byte walkAreasGrid[40][28]; /* movement grid */
184  byte mouseGrid[40][28]; /* mousegrid with index to indexadoObjetos */
199  Common::Point trajectories[9][30][5];
200  DoorRegistry doors[5]; /* doors in the room */
201  RoomBitmapRegister screenLayers[15];
202  RoomObjectListEntry *screenObjectIndex[51] = { nullptr }; /* includes name of objects for mouseover + index to object file*/
203  bool animationFlag; /* true if there is a secondary animation */
204  Common::String animationName; /* name of the secondary animation, 8 chars*/
205  bool paletteAnimationFlag; /* true if there exist palette animation */
206  uint16 palettePointer; /* points to the screen palette */
207  Common::Point secondaryAnimTrajectory[300]; /* trajectory of the secondary animation */
208  uint16 secondaryAnimDirections[300]; /* directions of the secondary trajectory. Pos 300 reflects object code. */
209  uint16 secondaryTrajectoryLength; /* length of the trajectory of the secondary animation */
210  ~RoomFileRegister() {
211  for (int i = 0; i < 51; i++) {
212  delete screenObjectIndex[i];
213  screenObjectIndex[i] = nullptr;
214  }
215  }
216 };
217 
218 struct SavedGame {
219  uint roomCode,
220  trajectoryLength,
221  currentTrajectoryIndex,
222  backpackObjectCode,
223  rightSfxVol,
224  leftSfxVol,
225  musicVolRight,
226  musicVolLeft,
227  oldGridX,
228  oldGridY,
229  secAnimDepth,
230  secAnimDir,
231  secAnimX,
232  secAnimY,
233  secAnimIFrame;
234  byte currentZone,
235  targetZone,
236  oldTargetZone,
237  inventoryPosition,
238  actionCode,
239  oldActionCode,
240  steps,
241  doorIndex,
242  characterFacingDir,
243  iframe,
244  gamePart;
245  bool isSealRemoved,
246  isPottersManualDelivered,
247  obtainedList1,
248  obtainedList2,
249  list1Complete,
250  list2Complete,
251  isVasePlaced,
252  isScytheTaken,
253  isTridentTaken,
254  isPottersWheelDelivered,
255  isMudDelivered,
256  isGreenDevilDelivered,
257  isCupboardOpen,
258  isChestOpen,
259  isTVOn,
260  isTrapSet,
261  isRedDevilCaptured;
262  InventoryEntry mobj[kInventoryIconCount];
263  int element1,
264  element2,
265  characterPosX,
266  characterPosY,
267  xframe2,
268  yframe2;
269  Common::String oldInventoryObjectName,
270  objetomoinventoryObjectNamehila;
271  Common::String characterName;
272  Route mainRoute;
273  uint16 firstList[5], secondList[5];
274  Common::Point trajectory[300];
275  // Conversation topic unlocks
276  bool firstTimeTopicA[kCharacterCount],
277  firstTimeTopicB[kCharacterCount],
278  firstTimeTopicC[kCharacterCount],
279  bookTopic[kCharacterCount],
280  mintTopic[kCharacterCount];
281 
282  bool caves[5];
283  uint niche[2][4];
284 };
285 
286 typedef byte Palette[768];
287 
288 enum HOTKEYS {
289  TALK = 0,
290  PICKUP = 1,
291  LOOKAT = 2,
292  USE = 3,
293  OPEN = 4,
294  CLOSE = 5,
295  YES = 6,
296  NO = 7
297 };
298 
299 } // End of namespace Tot
300 
301 #endif
Definition: str.h:59
Definition: types.h:104
Definition: types.h:95
Definition: types.h:218
Definition: types.h:125
Definition: types.h:109
Definition: types.h:179
Definition: types.h:168
Definition: rect.h:144
Definition: types.h:160
Definition: anims.h:26
Definition: types.h:173
uint16 code
Definition: types.h:129
Definition: types.h:118
Definition: types.h:99
Definition: atari-screen.h:42