Classes | |
| struct | HotspotSnapshot |
| struct | TranslationEntry |
Public Types | |
| enum | InputMode { None, Record, Playback } |
Public Types inherited from Engine | |
| enum | EngineFeature { kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime, kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions, kSupportsHelp, kSupportsQuitDialogOverride } |
Public Member Functions | |
| Graphics::ManagedSurface | readRLEImage (int64 offs, Common::MemoryReadStream *stream) |
| void | readResourceFile () |
| void | readExecutable () |
| void | readBackgroundAnimations (Common::MemoryReadStream *stream) |
| void | readImageResources (Common::MemoryReadStream *stream) |
| Macs2Engine (OSystem *osystem, const ADGameDescription *gameDesc) | |
| void | changeScene (uint32 newSceneIndex, bool executeScript=true) |
| bool | getPathfindingOverride (uint16 index, uint16 &result) |
| void | setPathfindingOverride (uint16 index, uint16 overrideValue) |
| uint16 | getPathfindingOverride2 (uint16 index) |
| void | removePathfindingOverride (uint16 index) |
| uint16 | getWalkabilityAt (int16 y, int16 x) |
| bool | isPathWalkable (int16 y1, int16 x1, int16 y2, int16 x2) |
| void | snapToWalkablePosition (int16 *pTargetY, int16 *pTargetX, int16 charY, int16 charX) |
| int | getPathfindingNodeCount () const |
| int | euclideanDistance (const Common::Point &a, const Common::Point &b) |
| int | walkableDistance (int nodeA, int nodeB) |
| int | computeMinCostToReachable (int nodeIndex, int prevNode, uint16 actorIndex, const bool *reachable, int nodeCount, const Common::Point &finalDest) |
| bool | loadOverlayFont (uint8 resourceIndex, uint16 executingObjectID) |
| bool | findGlyph (char c, GlyphData &out) const |
| void | setCursorMode (Script::MouseMode newMode) |
| void | nextCursorMode () |
| void | applyPaletteDarkening () |
| void | applyScenePaletteEffect () |
| void | updateBackgroundAnimationPalette () |
| bool | loadAnimationFromSceneData (uint16 objectIndex, uint16 slotIndex, uint8 arrayIndex, bool shouldMirror=false, uint16 executingScriptObjectId=0) |
| bool | loadObjectData (GameObject *obj) |
| void | clearObjectRuntime (GameObject *obj) |
| void | sortObjectsByDepth (uint16 objectIndex) |
| void | loadSongFromSceneData (uint8 dataIndex) |
| Music * | getAdlib () const |
| uint16 | scaledMusicVolume (uint16 gameAttenuation) const |
| void | setCurrentSoundData (const Common::Array< uint8 > &data) |
| void | clearCurrentSoundData () |
| void | playCurrentSound () |
| void | stopCurrentSound () |
| bool | hasCurrentSound () const |
| bool | isCurrentSoundPlaying () const |
| uint16 | getHotspotAtPoint (const Common::Point &p) |
| void | runScriptExecutor (bool firstRun=false) |
| void | setGameSpeedMode (uint16 mode) |
| void | startInputRecording (const Common::Path &filename) |
| void | startInputPlayback (const Common::Path &filename) |
| void | stopInputRecording () |
| void | recordInputFrame (uint16 mouseX, uint16 mouseY, uint16 buttons) |
| bool | readInputFrame (uint16 &mouseX, uint16 &mouseY, uint16 &buttons) |
| void | scheduleRun (bool initScene=false) |
| uint16 | getWalkabilityAt (const Common::Point &p) |
| int | measureString (const Common::String &s) |
| int | measureStrings (const Common::StringArray &sa) |
| int | measureStringsVertically (const Common::StringArray &sa) |
| Common::StringArray | decodeStrings (Common::MemoryReadStream *stream, int offset, int numStrings, int sceneId=0, int objectId=0) |
| void | loadTranslation () |
| Common::String | translateHotspotLabel (const Common::String &cp850Name) const |
| int | computeStringIndex (Common::MemoryReadStream *stream, int targetOffset) |
| uint32 | getFeatures () const |
| bool | isDemo () const |
| Common::String | getGameId () const |
| bool | hasFeature (EngineFeature f) const override |
| void | syncSoundSettings () override |
| bool | canLoadGameStateCurrently (Common::U32String *msg=nullptr) override |
| bool | canSaveGameStateCurrently (Common::U32String *msg=nullptr) override |
| Common::Error | loadGameState (int slot) override |
| Common::Error | syncGame (Common::Serializer &s) |
| Common::Error | saveGameStream (Common::WriteStream *stream, bool isAutosave=false) override |
| Common::Error | loadGameStream (Common::SeekableReadStream *stream) override |
| Common::Error | saveOriginalGameState (int dosSlot) |
| bool | tick () override |
| void | sayText (const Common::String &text, Common::TextToSpeechManager::Action action=Common::TextToSpeechManager::INTERRUPT_NO_REPEAT) const |
| void | getHotspotPositions (Common::Array< Graphics::HotspotInfo > &hotspots) override |
| bool | hotspotDirty () const override |
| void | rebuildHotspotSnapshot () const |
Public Member Functions inherited from Engine | |
| virtual void | showHotspots (bool show) |
| MetaEngine * | getMetaEngine () const |
| void | setMetaEngine (MetaEngine *metaEngine) |
| PauseToken | pauseEngine () |
| bool | isPaused () const |
| void | openMainMenuDialog () |
| uint32 | getTotalPlayTime () const |
| void | setTotalPlayTime (uint32 time=0) |
| Common::TimerManager * | getTimerManager () |
| Common::EventManager * | getEventManager () |
| Common::SaveFileManager * | getSaveFileManager () |
| bool | existExtractedCDAudioFiles (uint track=1) |
| bool | isDataAndCDAudioReadFromSameCD () |
| void | warnMissingExtractedCDAudio () |
| void | handleAutoSave () |
| void | saveAutosaveIfEnabled () |
| virtual bool | canSaveAutosaveCurrently () |
| virtual int | getAutosaveSlot () const |
| virtual bool | gameTypeHasAddOns () const |
| virtual bool | dirCanBeGameAddOn (const Common::FSDirectory &dir) const |
| virtual bool | dirMustBeGameAddOn (const Common::FSDirectory &dir) const |
| Common::ErrorCode | updateAddOns (const MetaEngine *metaEngine) const |
| Engine (OSystem *syst) | |
| virtual | ~Engine () |
| virtual void | initializePath (const Common::FSNode &gamePath) |
| virtual void | errorString (const char *buf_input, char *buf_output, int buf_output_size) |
| virtual GUI::Debugger * | getDebugger () final |
| void | setDebugger (GUI::Debugger *debugger) |
| GUI::Debugger * | getOrCreateDebugger () |
| bool | enhancementEnabled (int32 cls) |
| virtual void | applyGameSettings () |
| virtual void | flipMute () |
| virtual Common::String | getSaveStateName (int slot) const |
| void | setGameToLoadSlot (int slot) |
| virtual Common::Error | saveGameState (int slot, const Common::String &desc, bool isAutosave=false) |
| bool | saveGameDialog () |
| bool | loadGameDialog () |
Public Member Functions inherited from Macs2::Events | |
| void | runGame () |
| void | addView (UIElement *ui) |
| UIElement * | focusedView () const |
| Graphics::Screen * | getScreen () const |
| void | drawElements () |
| void | draw () override |
Public Member Functions inherited from Macs2::UIElement | |
| UIElement (const Common::String &name, UIElement *uiParent) | |
| UIElement (const Common::String &name) | |
| void | redraw () |
| Graphics::ManagedSurface | getSurface () const |
| virtual UIElement * | findView (const Common::String &name) |
Static Public Member Functions | |
| static bool | isWalkabilityBlocking (uint16 value) |
| static bool | isWalkabilityWalkable (uint16 value) |
Static Public Member Functions inherited from Engine | |
| static void | quitGame () |
| static bool | shouldQuit () |
| static bool | warnUserAboutUnsupportedGame (Common::String msg=Common::String()) |
| static bool | warnUserAboutUnsupportedAddOn (Common::String addOnName) |
| static void | warnUserAboutTestingMode () |
| static void | errorAddingAddOnWithoutBaseGame (Common::String addOnName, Common::String gameId) |
| static void | errorUnsupportedGame (Common::String extraMsg) |
Public Attributes | |
| Script::ScriptExecutor * | _scriptExecutor = nullptr |
| Graphics::ManagedSurface | _sceneBackground |
| Graphics::ManagedSurface | _hotspotMap |
| uint32 | _mapImageFileOffset = 0 |
| int64 | _mapSubSceneTableFilePos = 0 |
| Graphics::ManagedSurface | _depthMap |
| Graphics::ManagedSurface | _shadowMap |
| byte | _pal [256 *3] = {0} |
| byte | _palVanilla [256 *3] = {0} |
| Common::Array< Common::String > | _debugOutput |
| Common::Array< Common::String > | _textLog |
| Graphics::ManagedSurface | _pathfindingMap |
| Common::Array< PathfindingAreaOverride > | _pathfindingOverrides |
| uint16 | _areaOverrides [(239 - 200+1)] = {0} |
| uint16 | _pathfindingPoints [32] |
| Common::Array< PathfindingPoint > | pathfindingPoints |
| Common::Array< Common::Point > | _path |
| Common::Array< uint16 > | _hotspotOverrides |
| Common::Array< Macs2::AnimFrame > | _imageResources |
| GlyphData | _glyphs [256] |
| GlyphData | _panelGlyphs [256] |
| GlyphData | _overlayGlyphs [256] |
| uint16 | numOverlayGlyphs = 0 |
| uint16 | maxOverlayGlyphHeight = 0 |
| uint16 | numPanelGlyphs = 0 |
| uint16 | maxPanelGlyphHeight = 0 |
| uint16 | numGlyphs = 79 |
| uint16 | maxGlyphHeight |
| AnimFrame | _animFrames [6] |
| Common::Array< byte > | _shadingTable |
| Common::Array< byte > | _panelRemapTable |
| uint32 | _mapSceneOffsets [256] = {0} |
| Common::Array< BackgroundAnimation > | _backgroundAnimations |
| Common::Array< BackgroundAnimationBlob > | _backgroundAnimationsBlobs |
| Common::MemoryReadStream * | _fileStream |
| Common::Array< uint16 > | _hotspotColorTable |
| uint16 | _numPathfindingPoints |
| uint16 | _walkDepthThresholdY |
| uint16 | _walkDepthScaleFactor |
| uint16 | _walkBaseSpeedPct |
| uint16 | _scenePaletteMode |
| uint16 | _paletteDarkenPercent |
| bool | _movementFinishedFlag = false |
| Common::Array< uint32 > | _sceneResourceOffsets |
| uint16 | _numHotspots |
| uint32 | _sceneTimerParams [4] = {0} |
| bool | _clipRectDirty = false |
| Common::Array< uint16 > | inventoryIconIndices |
| Common::Array< uint16 > | containerInventoryIconIndices |
| bool | _runScheduled = false |
| bool | _scheduledRunIsInitScene = false |
| uint16 | _gameSpeedMode = 0 |
| InputMode | _inputMode = InputMode::None |
| Common::WriteStream * | _inputRecordStream = nullptr |
| Common::SeekableReadStream * | _inputPlaybackStream = nullptr |
| uint32 | _inputFrameCounter = 0 |
| uint32 | _inputPlaybackEndFrame = 0 |
| Common::Array< uint8 > | _currentSoundData |
| Audio::SoundHandle | _currentSoundHandle |
| Common::HashMap< uint32, TranslationEntry > | _sceneTranslations |
| Common::HashMap< uint32, TranslationEntry > | _objectTranslations |
| Common::HashMap< Common::String, Common::String > | _hotspotLabelTranslations |
| HotspotSnapshot | _hotspotSnapshot |
Public Attributes inherited from Engine | |
| OSystem * | _system |
| Audio::Mixer * | _mixer |
Public Attributes inherited from Macs2::Events | |
| uint32 | currentMillis = 0 |
Protected Member Functions | |
| Common::Error | run () override |
| bool | shouldQuit () const override |
Protected Member Functions inherited from Engine | |
| virtual int | runDialog (GUI::Dialog &dialog) |
| void | defaultSyncSoundSettings () |
| virtual void | pauseEngineIntern (bool pause) |
| virtual void | drawHotspots () |
Protected Member Functions inherited from Macs2::Events | |
| void | processEvent (Common::Event &ev) |
| bool | msgAction (const ActionMessage &e) override |
| bool | msgFocus (const FocusMessage &e) override |
| bool | msgUnfocus (const UnfocusMessage &e) override |
| bool | msgKeypress (const KeypressMessage &e) override |
| bool | msgMouseDown (const MouseDownMessage &e) override |
| bool | msgMouseUp (const MouseUpMessage &e) override |
Protected Member Functions inherited from Macs2::UIElement | |
| virtual bool | msgMouseMove (const MouseMoveMessage &e) |
Additional Inherited Members | |
Protected Attributes inherited from Engine | |
| Common::TimerManager * | _timer |
| Common::EventManager * | _eventMan |
| Common::SaveFileManager * | _saveFileMan |
| GUI::Dialog * | _mainMenuDialog |
| const Common::String | _targetName |
| int32 | _activeEnhancements = kEnhGameBreakingBugFixes |
| bool | _showHotspots |
| bool | _hotspotForceRedraw |
| bool | _hotspotPrevCursorVisible |
Protected Attributes inherited from Macs2::UIElement | |
| Common::Array< UIElement * > | _children |
| Common::Rect | _innerBounds |
| Bounds | _bounds |
| bool | _needsRedraw = true |
| Common::String | _name |
|
overrideprotectedvirtual |
Initialize the engine and start its main loop.
Implements Engine.
|
inlineoverrideprotectedvirtual |
Returns true if the game should quit
Implements Macs2::Events.
| Common::String Macs2::Macs2Engine::getGameId | ( | ) | const |
Returns the game Id
|
inlineoverridevirtual |
Determine whether the engine supports the specified feature.
Reimplemented from Engine.
|
overridevirtual |
Notify the engine that the sound settings in the config manager might have changed and that it should adjust any internal volume (and other) values accordingly.
The default implementation sets the volume levels of all mixer sound types according to the config entries of the active domain. When overwriting, call the default implementation first, then adjust the volumes further (if required).
Reimplemented from Engine.
|
inlineoverridevirtual |
Indicate whether a game state can be loaded.
| msg | Optional pointer to message explaining why it is disabled |
Reimplemented from Engine.
|
inlineoverridevirtual |
Indicate whether a game state can be saved.
| msg | Optional pointer to message explaining why it is disabled |
Reimplemented from Engine.
|
overridevirtual |
Load a game state.
| slot | The slot from which a save state should be loaded. |
Reimplemented from Engine.
| Common::Error Macs2::Macs2Engine::syncGame | ( | Common::Serializer & | s | ) |
Uses a serializer to allow implementing savegame loading and saving using a single method. Produces binary-compatible saves with the original DOS game.
|
inlineoverridevirtual |
Save a game state.
| stream | The write stream to save the savegame data to. |
| isAutosave | Expected to be true if an autosave is being created. |
Reimplemented from Engine.
|
inlineoverridevirtual |
Load a game state.
| stream | The stream to load the save state from. |
Reimplemented from Engine.
|
overridevirtual |
Called once every game frame
Reimplemented from Macs2::Events.
|
overridevirtual |
Get information about all hotspots that should be displayed.
Engines should override this method to populate the hotspots array with hotspot information in game screen coordinates.
| hotspots | Array to be filled with hotspot information |
Reimplemented from Engine.
|
overridevirtual |
Returns whether hotspot markers need to be re-rendered this frame.
The default implementation always returns true. Engines may override this to return false when hotspot positions have not changed (e.g. no object state change, no screen pan), avoiding an unnecessary overlay redraw.
Reimplemented from Engine.