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-str.h" 31 #include "common/random.h" 32 #include "common/serializer.h" 33 #include "common/events.h" 34 #include "common/util.h" 35 #include "engines/engine.h" 36 #include "engines/savestate.h" 38 #include "mediastation/clients.h" 39 #include "mediastation/detection.h" 40 #include "mediastation/datafile.h" 41 #include "mediastation/boot.h" 42 #include "mediastation/context.h" 43 #include "mediastation/actor.h" 44 #include "mediastation/cursors.h" 45 #include "mediastation/graphics.h" 46 #include "mediastation/profile.h" 47 #include "mediastation/mediascript/function.h" 48 #include "mediastation/actors/stage.h" 52 struct MediaStationGameDescription;
63 static const char *
const directoryGlobs[] = {
79 uint32 getFeatures()
const;
82 const char *getAppName()
const;
88 bool isFirstGenerationEngine();
89 void dispatchSystemEvents();
90 void draw(
bool dirtyOnly =
true);
92 void registerActor(
Actor *actorToAdd);
93 void destroyActor(uint actorId);
94 void destroyContext(uint contextId,
bool eraseFromLoadedContexts =
true);
95 bool contextIsLocked(uint contextId);
97 void readUnrecognizedFromStream(
Chunk &chunk, uint sectionType);
100 Actor *getActorById(uint actorId);
101 Actor *getActorByIdAndType(uint actorId, ActorType expectedType);
103 ChannelClient *getChannelClientByChannelIdent(uint channelIdent);
108 RootStage *getRootStage() {
return _stageDirector->getRootStage(); }
110 Document *getDocument() {
return _document; }
112 Common::String formatActorName(uint actorId,
bool attemptToGetType =
false) {
return _profile->formatActorName(actorId, attemptToGetType); }
113 Common::String formatActorName(
const Actor *actor) {
return _profile->formatActorName(actor); }
114 Common::String formatFunctionName(uint functionId) {
return _profile->formatFunctionName(functionId); }
115 Common::String formatFileName(uint fileId) {
return _profile->formatFileName(fileId); }
116 Common::String formatVariableName(uint variableId) {
return _profile->formatVariableName(variableId); }
117 Common::String formatParamTokenName(uint paramToken) {
return _profile->formatParamTokenName(paramToken); }
118 Common::String formatAssetNameForChannelIdent(uint channelIdent) {
return _profile->formatAssetNameForChannelIdent(channelIdent); }
120 const FileInfo &fileInfoForIdent(uint fileId) {
return _fileMap.getValOrDefault(fileId); }
121 const StreamInfo &streamInfoForIdent(uint streamId) {
return _streamMap.getValOrDefault(streamId); }
122 const ScreenReference &screenRefWithId(uint screenActorId) {
return _screenReferences.getValOrDefault(screenActorId); }
123 const ContextReference &contextRefWithId(uint contextId) {
return _contextReferences.getValOrDefault(contextId); }
128 SpatialEntity *getMouseInsideHotspot() {
return _mouseInsideHotspot; }
129 void setMouseInsideHotspot(
SpatialEntity *entity) { _mouseInsideHotspot = entity; }
130 void clearMouseInsideHotspot() { _mouseInsideHotspot =
nullptr; }
132 SpatialEntity *getMouseDownHotspot() {
return _mouseDownHotspot; }
133 void setMouseDownHotspot(
SpatialEntity *entity) { _mouseDownHotspot = entity; }
134 void clearMouseDownHotspot() { _mouseDownHotspot =
nullptr; }
138 static const uint SCREEN_WIDTH = 640;
139 static const uint SCREEN_HEIGHT = 480;
140 static const uint BOOT_STREAM_ID = 1;
173 uint _functionTableSize = 0;
176 void initDisplayManager();
177 void initCursorManager();
178 void initFunctionManager();
180 void initDeviceOwner();
181 void initStageDirector();
182 void initStreamFeedManager();
184 void setupInitialStreamMap();
188 virtual void readChunk(
Chunk &chunk)
override;
189 void readDocumentDef(
Chunk &chunk);
190 void readDocumentInfoFromStream(
Chunk &chunk, BootSectionType sectionType);
191 void readVersionInfoFromStream(
Chunk &chunk);
192 void readContextReferencesFromStream(
Chunk &chunk);
193 void readScreenReferencesFromStream(
Chunk &chunk);
194 void readAndAddFileMaps(
Chunk &chunk);
195 void readAndAddStreamMaps(
Chunk &chunk);
197 void readControlCommands(
Chunk &chunk);
198 void readCommandFromStream(
Chunk &chunk, ContextSectionType sectionType);
199 void readCreateContextData(
Chunk &chunk);
200 void readDestroyContextData(
Chunk &chunk);
201 void readCreateActorData(
Chunk &chunk);
202 void readDestroyActorData(
Chunk &chunk);
203 void readActorLoadComplete(
Chunk &chunk);
204 void readCreateVariableData(
Chunk &chunk);
205 void readContextNameData(
Chunk &chunk);
207 void destroyActorsInContext(uint contextId);
211 #define SHOULD_QUIT ::MediaStation::g_engine->shouldQuit() 215 #endif // MEDIASTATION_H
EngineFeature
Definition: engine.h:258
Definition: advancedDetector.h:164