22 #ifndef MEDIASTATION_H 23 #define MEDIASTATION_H 25 #include "audio/mixer.h" 26 #include "common/scummsys.h" 27 #include "common/system.h" 28 #include "common/error.h" 29 #include "common/fs.h" 30 #include "common/hash-ptr.h" 31 #include "common/hash-str.h" 32 #include "common/random.h" 33 #include "common/serializer.h" 34 #include "common/events.h" 35 #include "common/util.h" 36 #include "engines/engine.h" 37 #include "engines/savestate.h" 39 #include "mediastation/actor.h" 40 #include "mediastation/actors/stage.h" 41 #include "mediastation/boot.h" 42 #include "mediastation/clients.h" 43 #include "mediastation/context.h" 44 #include "mediastation/cursors.h" 45 #include "mediastation/datafile.h" 46 #include "mediastation/detection.h" 47 #include "mediastation/events.h" 48 #include "mediastation/graphics.h" 49 #include "mediastation/mediascript/function.h" 50 #include "mediastation/profile.h" 54 struct MediaStationGameDescription;
68 static const char *
const directoryGlobs[] = {
82 uint32 getFeatures()
const;
85 const char *getAppName()
const;
93 RootStage *getRootStage() {
return _stageDirector->getRootStage(); }
96 EventLoop *getEventLoop() {
return _eventLoop; }
97 Document *getDocument() {
return _document; }
98 TimerService *getTimerService() {
return _timerService; }
99 ImtGod *getImtGod() {
return _imtGod; }
103 void serviceSounds();
105 Common::String formatActorName(uint actorId,
bool attemptToGetType =
false) {
return _profile->formatActorName(actorId, attemptToGetType); }
106 Common::String formatActorName(
const Actor *actor) {
return _profile->formatActorName(actor); }
107 Common::String formatFunctionName(uint functionId) {
return _profile->formatFunctionName(functionId); }
108 Common::String formatFileName(uint fileId) {
return _profile->formatFileName(fileId); }
109 Common::String formatVariableName(uint variableId) {
return _profile->formatVariableName(variableId); }
110 Common::String formatParamTokenName(uint paramToken) {
return _profile->formatParamTokenName(paramToken); }
111 Common::String formatAssetNameForChannelIdent(uint channelIdent) {
return _profile->formatAssetNameForChannelIdent(channelIdent); }
113 SpatialEntity *getMouseInsideHotspot() {
return _mouseInsideHotspot; }
114 void setMouseInsideHotspot(
SpatialEntity *entity) { _mouseInsideHotspot = entity; }
115 void clearMouseInsideHotspot() { _mouseInsideHotspot =
nullptr; }
117 SpatialEntity *getMouseDownHotspot() {
return _mouseDownHotspot; }
118 void setMouseDownHotspot(
SpatialEntity *entity) { _mouseDownHotspot = entity; }
119 void clearMouseDownHotspot() { _mouseDownHotspot =
nullptr; }
121 static const uint SCREEN_WIDTH = 640;
122 static const uint SCREEN_HEIGHT = 480;
123 static const uint BOOT_STREAM_ID = 1;
141 ImtGod *_imtGod =
nullptr;
154 void initCursorManager();
155 void queueMouseEvent(EventType type,
const Common::Point &point);
163 virtual ~
ImtGod()
override;
165 void addConstructedActor(
Actor *actorToAdd);
166 void destroyActor(uint actorId);
169 void destroyContext(uint contextId,
bool eraseFromLoadedContexts =
true);
170 void destroyAllContexts();
171 void lockContext(uint contextId);
172 bool contextIsLocked(uint contextId);
173 void clearAllContextLocks();
175 void readUnrecognizedFromStream(
Chunk &chunk, uint sectionType);
176 void readHeaderSections(
Subfile &subfile,
Chunk &chunk);
178 const FileInfo &fileInfoForIdent(uint fileId) {
return _fileMap.getValOrDefault(fileId); }
179 const StreamInfo &streamInfoForIdent(uint streamId) {
return _streamMap.getValOrDefault(streamId); }
180 const ScreenReference &screenRefWithId(uint screenActorId) {
return _screenReferences.getValOrDefault(screenActorId); }
181 const ContextReference &contextRefWithId(uint contextId) {
return _contextReferences.getValOrDefault(contextId); }
183 Actor *getActorById(uint actorId);
184 Actor *getActorByIdAndType(uint actorId, ActorType expectedType);
186 ChannelClient *getChannelClientByChannelIdent(uint channelIdent);
188 Context *getContextById(uint contextId);
190 bool isFirstGenerationEngine()
const;
191 void setupInitialStreamMap();
210 uint _functionTableSize = 0;
213 virtual void readChunk(
Chunk &chunk)
override;
214 void readDocumentDef(
Chunk &chunk);
215 void readDocumentInfoFromStream(
Chunk &chunk, BootSectionType sectionType);
216 void readVersionInfoFromStream(
Chunk &chunk);
217 void readContextReferencesFromStream(
Chunk &chunk);
218 void readScreenReferencesFromStream(
Chunk &chunk);
219 void readAndAddFileMaps(
Chunk &chunk);
220 void readAndAddStreamMaps(
Chunk &chunk);
222 void readControlCommands(
Chunk &chunk);
223 void readCommandFromStream(
Chunk &chunk, ContextSectionType sectionType);
224 void readCreateContextData(
Chunk &chunk);
225 void readDestroyContextData(
Chunk &chunk);
226 void readCreateActorData(
Chunk &chunk);
227 void readDestroyActorData(
Chunk &chunk);
228 void readActorLoadComplete(
Chunk &chunk);
229 void readCreateVariableData(
Chunk &chunk);
230 void readSetContextName(
Chunk &chunk);
232 void destroyActorsInContext(uint contextId);
236 #define SHOULD_QUIT ::MediaStation::g_engine->shouldQuit() 240 #endif // MEDIASTATION_H
EngineFeature
Definition: engine.h:258
Definition: advancedDetector.h:164