ScummVM API documentation
worldstats.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 ASYLUM_RESOURCES_WORLDSTATS_H
23 #define ASYLUM_RESOURCES_WORLDSTATS_H
24 
25 #include "common/array.h"
26 #include "common/rect.h"
27 #include "common/serializer.h"
28 
29 #include "asylum/system/sound.h"
30 
31 namespace Asylum {
32 
33 #define ACTORS_MAX_COUNT 50
34 #define OBJECTS_MAX_COUNT 400
35 #define ACTIONS_MAX_COUNT 400
36 
37 #define ACTORS_SIZE 2468
38 #define ACTORDATA_SIZE 1448
39 #define OBJECTS_SIZE 1704
40 #define ACTIONS_SIZE 180
41 
42 class Actor;
43 class Object;
44 class AsylumEngine;
45 
46 struct ActionArea;
47 
48 enum CursorResourceType {
49  kCursorResourceScrollUp = 0,
50  kCursorResourceScrollUpLeft,
51  kCursorResourceScrollLeft,
52  kCursorResourceScrollDownLeft,
53  kCursorResourceScrollDown,
54  kCursorResourceScrollDownRight,
55  kCursorResourceScrollRight,
56  kCursorResourceScrollUpRight,
57  kCursorResourceHand,
58  kCursorResourceMagnifyingGlass,
59  kCursorResourceTalkNPC,
60  kCursorResourceGrabPointer,
61  kCursorResourceTalkNPC2
62 };
63 
65 public:
66  WorldStats(AsylumEngine *engine);
67  virtual ~WorldStats();
68 
74  void load(Common::SeekableReadStream *stream);
75 
76  int32 size;
77  int32 numEntries;
78  ChapterIndex chapter;
79  int16 xLeft; // scene start x position
80  int16 yTop; // scene start y position
81  Common::Rect boundingRect;
82  ResourceId backgroundImage;
83  ResourceId cursorResources[13];
84  ResourceId font1;
85  ResourceId font2;
86  ResourceId font3;
87  ResourceId currentPaletteId;
88  int32 cellShadeMask1;
89  int32 cellShadeMask2;
90  int32 cellShadeMask3;
91  int32 unused;
92  int32 smallCurUp;
93  int32 smallCurDown;
94  ResourceId encounterFrameBg;
95  int16 width;
96  int16 height;
97  int32 motionStatus;
98  int32 field_8C;
99  //uint32 numActions;
100  //uint32 numObjects;
101  int16 coordinates[7];
102  //uint32 numActors;
103  int32 reverseStereo;
104  Common::Rect sceneRects[6]; // including scene size rect
105  uint8 sceneRectIdx;
106  uint8 field_11D[3];
107  int32 field_120;
108  int32 scriptIndex; // actionList start index
109  ResourceId graphicResourceIds[100];
110  ResourceId sceneTitleGraphicResourceId;
111  ResourceId sceneTitlePaletteResourceId;
112  int32 actorType;
113  ResourceId soundResourceIds[50];
114  AmbientSoundItem ambientSounds[15];
115  uint32 numAmbientSounds;
116  int32 musicStatus;
117  int32 musicCurrentResourceIndex;
118  int32 musicFlag;
119  int32 musicResourceIndex;
120  int32 musicStatusExt;
121  Common::Array<Object *> objects; // maxsize 400
122  Common::Array<Actor *> actors; // maxsize 50
123  // ActorData is stored in each actor instance
124  uint32 numScripts;
125  uint32 numPolygons;
126  ResourceId inventoryIconsActive[16];
127  ResourceId inventoryIconsNormal[16];
128  ResourceId inventoryCursorsNormal[16];
129  ResourceId inventoryCursorsBlinking[16];
130  Common::Array<ActionArea *> actions; // maxsize 400
131  int32 field_E848C;
132  int32 field_E8490;
133  int32 field_E8494;
134  int32 field_E8498;
135  int32 field_E849C; // ActorIndex???
136  int32 tickValueArray[30];
137  int32 field_E8518;
138  int32 field_E851C[30];
139  int32 field_E8594[30];
140  ActorIndex nextPlayer;
141  uint32 field_E8610[6];
142  uint32 field_E8628[6];
143  Object *wheels[7];
144  uint32 tickCount1;
145  uint32 field_E8660[6];
146  int32 dword_4563A0;
147 
148  void setWheelObjects();
149 
150  int32 getActionAreaIndexById(int32 id);
151  int32 getRandomActionAreaIndexById(int32 id);
152  ActionArea *getActionAreaById(int32 id);
153 
154  Object *getObjectById(ObjectId id);
155 
156  Common::String toString();
157 
158  // Serializable
159  void saveLoadWithSerializer(Common::Serializer &s);
160 
161 private:
162  AsylumEngine *_vm;
163 };
164 
165 } // end of namespace Asylum
166 
167 #endif // ASYLUM_RESOURCES_WORLDSTATS_H
Definition: str.h:59
Definition: asylum.h:53
Definition: rect.h:144
Definition: stream.h:745
Definition: serializer.h:79
Definition: worldstats.h:64
Definition: script.h:58
void load(Common::SeekableReadStream *stream)
Definition: asylum.h:73
Definition: serializer.h:308
Definition: sound.h:72
Definition: object.h:38