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/debugger.h" 47 #include "mediastation/detection.h" 48 #include "mediastation/events.h" 49 #include "mediastation/graphics.h" 50 #include "mediastation/mediascript/function.h" 51 #include "mediastation/profile.h" 55 struct MediaStationGameDescription;
70 static const char *
const directoryGlobs[] = {
84 uint32 getFeatures()
const;
87 const char *getAppName()
const;
90 void generateMouseUpdateEvent();
91 uint currentTimeInSeconds();
95 PrintManager *getPrintManager() {
return _printManager; }
98 RootStage *getRootStage() {
return _stageDirector->getRootStage(); }
101 EventLoop *getEventLoop() {
return _eventLoop; }
102 Document *getDocument() {
return _document; }
103 TimerService *getTimerService() {
return _timerService; }
104 ImtGod *getImtGod() {
return _imtGod; }
108 void serviceSounds();
110 Common::String formatActorName(uint actorId,
bool attemptToGetType =
false,
bool includeDefaultName =
true) {
return _profile->formatActorName(actorId, attemptToGetType, includeDefaultName); }
111 Common::String formatActorName(
const Actor *actor,
bool includeDefaultName =
true) {
return _profile->formatActorName(actor, includeDefaultName); }
112 Common::String formatFunctionName(uint functionId,
bool includeDefaultName =
true) {
return _profile->formatFunctionName(functionId, includeDefaultName); }
113 Common::String formatFileName(uint fileId,
bool includeDefaultName =
true) {
return _profile->formatFileName(fileId, includeDefaultName); }
114 Common::String formatVariableName(uint variableId,
bool includeDefaultName =
true) {
return _profile->formatVariableName(variableId, includeDefaultName); }
115 Common::String formatParamTokenName(uint paramToken,
bool includeDefaultName =
true) {
return _profile->formatParamTokenName(paramToken, includeDefaultName); }
116 Common::String formatAssetNameForChannelIdent(uint channelIdent,
bool includeDefaultName =
true) {
return _profile->formatAssetNameForChannelIdent(channelIdent, includeDefaultName); }
118 SpatialEntity *getMouseInsideHotspot() {
return _mouseInsideHotspot; }
119 void setMouseInsideHotspot(
SpatialEntity *entity) { _mouseInsideHotspot = entity; }
120 void clearMouseInsideHotspot() { _mouseInsideHotspot =
nullptr; }
122 SpatialEntity *getMouseDownHotspot() {
return _mouseDownHotspot; }
123 void setMouseDownHotspot(
SpatialEntity *entity) { _mouseDownHotspot = entity; }
124 void clearMouseDownHotspot() { _mouseDownHotspot =
nullptr; }
126 static const uint SCREEN_WIDTH = 640;
127 static const uint SCREEN_HEIGHT = 480;
128 static const uint BOOT_STREAM_ID = 1;
147 ImtGod *_imtGod =
nullptr;
160 void initCursorManager();
161 void queueMouseEvent(EventType type,
const Common::Point &point);
170 virtual ~
ImtGod()
override;
172 void addConstructedActor(
Actor *actorToAdd);
173 void destroyActor(uint actorId);
176 void destroyContext(uint contextId,
bool eraseFromLoadedContexts =
true);
177 void destroyAllContexts();
178 void lockContext(uint contextId);
179 bool contextIsLocked(uint contextId);
180 void clearAllContextLocks();
182 void readUnrecognizedFromStream(
Chunk &chunk, uint sectionType);
183 void readHeaderSections(
Subfile &subfile,
Chunk &chunk);
185 const FileInfo &fileInfoForIdent(uint fileId) {
return _fileMap.getValOrDefault(fileId); }
186 const StreamInfo &streamInfoForIdent(uint streamId) {
return _streamMap.getValOrDefault(streamId); }
187 const ScreenReference &screenRefWithId(uint screenActorId) {
return _screenReferences.getValOrDefault(screenActorId); }
188 const ContextReference &contextRefWithId(uint contextId) {
return _contextReferences.getValOrDefault(contextId); }
190 Actor *getActorById(uint actorId);
191 Actor *getActorByIdAndType(uint actorId, ActorType expectedType);
193 ChannelClient *getChannelClientByChannelIdent(uint channelIdent);
195 Context *getContextById(uint contextId);
197 bool isFirstGenerationEngine()
const;
198 void setupInitialStreamMap();
217 uint _functionTableSize = 0;
220 virtual void readChunk(
Chunk &chunk)
override;
221 void readDocumentDef(
Chunk &chunk);
222 void readDocumentInfoFromStream(
Chunk &chunk, BootSectionType sectionType);
223 void readVersionInfoFromStream(
Chunk &chunk);
224 void readContextReferencesFromStream(
Chunk &chunk);
225 void readScreenReferencesFromStream(
Chunk &chunk);
226 void readAndAddFileMaps(
Chunk &chunk);
227 void readAndAddStreamMaps(
Chunk &chunk);
229 void readControlCommands(
Chunk &chunk);
230 void readCommandFromStream(
Chunk &chunk, ContextSectionType sectionType);
231 void readCreateContextData(
Chunk &chunk);
232 void readDestroyContextData(
Chunk &chunk);
233 void readCreateActorData(
Chunk &chunk);
234 void readDestroyActorData(
Chunk &chunk);
235 void readActorLoadComplete(
Chunk &chunk);
236 void readCreateVariableData(
Chunk &chunk);
237 void readSetContextName(
Chunk &chunk);
239 void destroyActorsInContext(uint contextId);
243 #define SHOULD_QUIT ::MediaStation::g_engine->shouldQuit() 247 #endif // MEDIASTATION_H
EngineFeature
Definition: engine.h:282
Definition: advancedDetector.h:164