ScummVM API documentation
Macs2::Macs2Engine Class Reference
Inheritance diagram for Macs2::Macs2Engine:
Engine Macs2::Events Macs2::UIElement

Classes

struct  DeltaAnimState
 
struct  DeltaFrame
 
struct  DeltaSfxEvent
 
struct  DeltaStrip
 
struct  HotspotSnapshot
 
struct  TranslationEntry
 

Public Types

enum  McsFileVersion { Unknown = 0, V1, V2 }
 
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::SeekableReadStream *stream)
 
void readResourceFile ()
 
McsFileVersion detectMcsFileVersion (Common::SeekableReadStream &stream) const
 
void loadResourceFileV1 ()
 
void loadResourceFileV2 ()
 
void bootstrapMcsActorsObjectsAndScene ()
 
void softRestart ()
 
const char * getResourceMcsFilename () const
 
void readAmigaResources ()
 
void applyAmigaUiPalette ()
 
void installAmigaPortraitPalette (bool copyFromPlayfield)
 
void buildAmigaPanelRemapTable ()
 
bool loadAmigaCursorResource (uint16 resourceId, AnimFrame &out)
 
bool loadAmigaMxffFont ()
 
bool loadAmigaOverlayFont (uint8 resourceIndex)
 
bool loadAmigaOverlayFontResource (uint16 ffId)
 
bool loadAmigaSceneBackground (uint32 sceneResourceId)
 
void initInventoryIconIndices ()
 
void readBackgroundAnimations (Common::SeekableReadStream *stream)
 
void readImageResources (Common::SeekableReadStream *stream)
 
 Macs2Engine (OSystem *osystem, const ADGameDescription *gameDesc)
 
void changeScene (uint32 newSceneIndex, bool executeScript=true)
 
void updateBackgroundAnimationDepthMap (size_t animIndex)
 
void updateAllBackgroundAnimationDepthMaps ()
 
bool loadOverlayFont (uint8 resourceIndex, uint16 executingObjectID)
 
bool resolveResourceFileOffset (uint8 resourceIndex, uint16 executingObjectId, uint32 &outOffset) const
 
bool loadSizedResourcePayload (uint8 resourceIndex, uint16 executingObjectId, Common::Array< uint8 > &outPayload)
 
bool loadAhffAnimResource (uint8 resourceIndex, uint16 executingObjectId, Common::Array< uint8 > &outBlob)
 
bool readMegaPicImage (Common::SeekableReadStream *stream, int width, int height, Graphics::ManagedSurface &out)
 
bool loadMaskFromResource (uint8 resourceIndex, uint16 executingObjectId, Graphics::ManagedSurface &dest, int megapicW, int megapicH, bool upscaleHalfRes=false)
 
bool loadDeltaAnimResource (uint8 resourceIndex, uint16 executingObjectId, bool forceSkipSpeed1=false)
 
void clearDeltaAnim ()
 
bool startDeltaPlayback (uint16 startFrame, uint16 endFrame, uint16 speedTicks, bool applyPalette)
 
bool tickDeltaPlayback ()
 
void applyDeltaFrameToBackground (const DeltaFrame &frame)
 
void playDeltaFrameSfx (uint16 displayFrame)
 
void setCursorMode (Script::MouseMode newMode)
 
void nextCursorMode ()
 
void applyPaletteDarkening ()
 
void readPalette (Common::SeekableReadStream *stream, Graphics::Palette &dest)
 
void expandPalette6To8 (Graphics::Palette &pal)
 
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)
 
MusicgetMusic () const
 
uint16 scaledMusicVolume (uint16 gameAttenuation) const
 
void setCurrentSoundData (const Common::Array< uint8 > &data, int rateHz=0x1F40, int headerSkip=2)
 
void clearCurrentSoundData ()
 
bool hasCurrentSoundData () const
 
void playSample ()
 
void stopSample ()
 
bool isSamplePlaying () const
 
void playAudioFile (const Common::Path &basename, bool speechBus)
 
void stopSpeech ()
 
bool isSpeechPlaying () const
 
uint16 getHotspotAtPoint (const Common::Point &p) const
 
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)
 
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
 
Common::String translateUiLabel (const Common::String &source) const
 
int computeStringIndex (Common::MemoryReadStream *stream, int targetOffset)
 
uint32 getFeatures () const
 
Common::Platform getPlatform () const
 
bool isAmiga () const
 
Macs2AmigaArchivegetAmigaArchive () const
 
bool isDemo () const
 
bool isV1 () const
 
bool isV2 () const
 
uint32 getMcsDirectoryOffset () const
 
McsFileVersion getMcsFileVersion () const
 
int screenWidth () const
 
int screenWidthLast () const
 
int gameHeight () const
 
int gameHeightLast () const
 
int screenHeight ()
 
int screenHeightLast ()
 
bool isBottomHudVisible () const
 
void setBottomHudVisible (bool visible)
 
bool hasNativeHudAssets () const
 
uint32 timerTickMs () const
 
uint16 ticksPerGameFrame () const
 
uint16 maxAnimSlots () const
 
uint16 maxOrientations () const
 
uint16 overloadAnimSlot () const
 
uint16 maxHotspots () const
 
uint maxObjectResources () const
 
uint16 resolveAnimSlotIndex (const GameObject *obj) const
 
bool scriptValuesHaveHighWord () const
 
bool scriptVarIndexHasPaddingWord () const
 
int16 scaleScriptCoord (int16 coord) const
 
int dialogPadW () const
 
int dialogPadH () const
 
int dialogTextInset () const
 
int dialogLineGap () const
 
int portraitBorderPad () const
 
int portraitContentInset () const
 
int portraitTextGap () const
 
int dialogLineHeight () const
 
uint8 depthThresholdForY (int16 charY) const
 
void loadBootstrapResources ()
 
bool loadSceneGraphics (uint32 sceneIndex)
 
bool loadSceneGraphicsV1 (uint32 sceneIndex)
 
bool loadSceneGraphicsV2 (uint32 sceneIndex)
 
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 syncGameV1 (Common::Serializer &s)
 
Common::Error syncGameV2 (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, uint16 speakerObjectId=0) const
 
void setTTSVoice (uint16 speakerObjectId) const
 
void stopTextToSpeech () 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)
 
MetaEnginegetMetaEngine () const
 
void setMetaEngine (MetaEngine *metaEngine)
 
PauseToken pauseEngine ()
 
bool isPaused () const
 
void openMainMenuDialog ()
 
uint32 getTotalPlayTime () const
 
void setTotalPlayTime (uint32 time=0)
 
Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
Common::SaveFileManagergetSaveFileManager ()
 
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::DebuggergetDebugger () final
 
void setDebugger (GUI::Debugger *debugger)
 
GUI::DebuggergetOrCreateDebugger ()
 
bool enhancementEnabled (int32 cls) const
 
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)
 
UIElementfocusedView () const
 
Graphics::ScreengetScreen () 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 UIElementfindView (const Common::String &name)
 

Static Public Member Functions

static uint16 specialAnimSlotToAnimSlot (uint16 specialSlot)
 
- 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
 
Graphics::ManagedSurface _depthMap
 
Graphics::ManagedSurface _sceneDepthMap
 
Graphics::ManagedSurface _shadowMap
 
Graphics::Palette _pal {Graphics::PALETTE_COUNT}
 
Graphics::Palette _palVanilla {Graphics::PALETTE_COUNT}
 
Common::Array< Common::String_debugOutput
 
Common::Array< Common::String_textLog
 
Pathfinding _pathfinding
 
Common::Array< uint16 > _hotspotOverrides
 
Common::Array< Macs2::AnimFrame_imageResources
 
Common::Point _cursorHotspots [33]
 
Text _text
 
DeltaAnimState _deltaAnim
 
AnimFrame _animFrames [6]
 
Common::Array< byte > _shadingTable
 
Common::Array< byte > _panelRemapTable
 
uint32 _helpOffsets [256] = {0}
 
Common::Array< BackgroundAnimation_backgroundAnimations
 
Common::Array< BackgroundAnimationBlob_backgroundAnimationsBlobs
 
Common::SeekableReadStream_fileStream = nullptr
 
McsFileVersion _mcsFileVersion = McsFileVersion::Unknown
 
uint32 _mcsDirectoryOffset = kMcsV1DirectoryOffset
 
bool _amigaNativePlayfieldPalette = false
 
Common::Array< byte > _amigaLineCopperPal
 
Macs2AmigaArchive_amigaArchive = nullptr
 
Common::Array< byte > _amigaPendingSceneScript
 
Common::Array< byte > _amigaPendingSceneStrings
 
Common::String _ttsPreviousSaid
 
bool _bottomHudVisible = true
 
Graphics::ManagedSurface _hudMegapics [6]
 
bool _hudMegapicLoaded [6] = {}
 
Common::Array< HudButton_hudButtons
 
uint16 _panelTopY = 0
 
uint16 _panelHeight = 0
 
MenuMode _menuMode = MenuMode::Main
 
OptionsSubMode _optionsSubMode = OptionsSubMode::None
 
Script::MouseMode _savedMenuCursorMode = Script::MouseMode::Walk
 
uint16 _inventScroll = 1
 
uint16 _inventOriginX = 0
 
uint16 _inventOriginY = 0
 
uint16 _inventCols = 4
 
uint16 _inventRows = 2
 
uint16 _inventSlotW = 64
 
uint16 _inventSlotH = 52
 
uint16 _inventLayoutMode = 0
 
uint16 _hudTextLayout [7] = {}
 
uint16 _hudTextRecolor [4] = {}
 
uint16 _saveListScroll = 1
 
Common::Array< Common::String_saveSlotNames
 
uint16 _skipSpeed = 1
 
Common::Array< uint16 > _hotspotColorTable
 
uint16 _walkDepthThresholdY
 
uint16 _walkDepthScaleFactor
 
uint16 _walkBaseSpeedPct
 
uint16 _scenePaletteMode
 
uint16 _paletteDarkenPercent
 
bool _movementFinishedFlag = false
 
Common::Array< uint32 > _sceneResourceOffsets
 
uint16 _talkVol = 0
 
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
 
int _currentSoundRate = 0x1F40
 
int _currentSoundHeaderSkip = 2
 
Audio::SoundHandle _currentSoundHandle
 
Audio::SoundHandle _speechSoundHandle
 
Common::HashMap< uint32, TranslationEntry_sceneTranslations
 
Common::HashMap< uint32, TranslationEntry_objectTranslations
 
Common::HashMap< Common::String, Common::String_hotspotLabelTranslations
 
Common::HashMap< Common::String, Common::String_uiLabelTranslations
 
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
 

Member Enumeration Documentation

◆ McsFileVersion

MCS dialect from the 12-byte file magic.

Member Function Documentation

◆ run()

Common::Error Macs2::Macs2Engine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ shouldQuit()

bool Macs2::Macs2Engine::shouldQuit ( ) const
inlineoverrideprotectedvirtual

Returns true if the game should quit

Implements Macs2::Events.

◆ readResourceFile()

void Macs2::Macs2Engine::readResourceFile ( )

Open primary MCS archive, check magic, load v1 or v2 layout.

◆ loadResourceFileV1()

void Macs2::Macs2Engine::loadResourceFileV1 ( )

Load AHFFMACS0100 layout

◆ loadResourceFileV2()

void Macs2::Macs2Engine::loadResourceFileV2 ( )

Load AHFFMACS0200 layout

◆ bootstrapMcsActorsObjectsAndScene()

void Macs2::Macs2Engine::bootstrapMcsActorsObjectsAndScene ( )

Shared actor/scene/object directory load after dialect-specific globals

◆ softRestart()

void Macs2::Macs2Engine::softRestart ( )

Soft restart (options button 0x20 / Macs2PretReInit).

◆ readAmigaResources()

void Macs2::Macs2Engine::readAmigaResources ( )

Amiga: open DataA/Mdir, load OO objects as GameObjects, cursors, and scene stubs.

◆ installAmigaPortraitPalette()

void Macs2::Macs2Engine::installAmigaPortraitPalette ( bool  copyFromPlayfield)

Ensure Amiga dialogue portraits can use playfield COLOR17..31. After native MM copper load those slots are already correct; otherwise seed them from MXIN chrome (copper base16 layout).

◆ loadAmigaSceneBackground()

bool Macs2::Macs2Engine::loadAmigaSceneBackground ( uint32  sceneResourceId)

Amiga: load native MM_* MXMM package by resource id (not script scene id). Script-visible scene ids are resourceId+1. Also extracts trailer script/strings into _amigaPendingScene* for changeScene. Palette indices 0..31 stay Amiga COLOR registers for OO sprite compatibility.

◆ updateBackgroundAnimationDepthMap()

void Macs2::Macs2Engine::updateBackgroundAnimationDepthMap ( size_t  animIndex)

Sync depth map with the current background animation frame (v1 gate fix).

◆ resolveResourceFileOffset()

bool Macs2::Macs2Engine::resolveResourceFileOffset ( uint8  resourceIndex,
uint16  executingObjectId,
uint32 &  outOffset 
) const

Resolve scene/object resource table entry to an absolute MCS file offset. Shared by sized-resource loads, AHFFANIM, AHFFDLTA, and MegaPic masks.

◆ loadSizedResourcePayload()

bool Macs2::Macs2Engine::loadSizedResourcePayload ( uint8  resourceIndex,
uint16  executingObjectId,
Common::Array< uint8 > &  outPayload 
)

Read size-prefixed resource payload (size dword excluded from outPayload).

◆ loadAhffAnimResource()

bool Macs2::Macs2Engine::loadAhffAnimResource ( uint8  resourceIndex,
uint16  executingObjectId,
Common::Array< uint8 > &  outBlob 
)

Decode AHFFANIM0100 body into a runtime anim blob.

◆ readMegaPicImage()

bool Macs2::Macs2Engine::readMegaPicImage ( Common::SeekableReadStream stream,
int  width,
int  height,
Graphics::ManagedSurface out 
)

Decode MegaPic row-RLE into dest (width x height).

◆ loadMaskFromResource()

bool Macs2::Macs2Engine::loadMaskFromResource ( uint8  resourceIndex,
uint16  executingObjectId,
Graphics::ManagedSurface dest,
int  megapicW,
int  megapicH,
bool  upscaleHalfRes = false 
)

Load a MegaPic mask resource into dest. If upscaleHalfRes, decode at (width x height) then nearest-neighbor 2x into dest sized (width*2 x height*2). Otherwise dest is created at width x height.

◆ setCurrentSoundData()

void Macs2::Macs2Engine::setCurrentSoundData ( const Common::Array< uint8 > &  data,
int  rateHz = 0x1F40,
int  headerSkip = 2 
)

Install PCM for opcode 0x3E / playSample.

Parameters
rateHzsample rate (DOS Sound Blaster path uses 8000)
headerSkipbytes to skip at start of buffer (DOS resources have a 2-byte size header; Amiga MXOS extract is raw PCM and uses 0)

◆ playAudioFile()

void Macs2::Macs2Engine::playAudioFile ( const Common::Path basename,
bool  speechBus 
)

Play digital audio by basename (no extension). Tries flac/ogg/mp3/m4a/wav via SeekableAudioStream::openStreamFile (codec #ifdefs live in audio/). SPEECH paths use the speech mixer handle; others use the SFX handle.

◆ translateUiLabel()

Common::String Macs2::Macs2Engine::translateUiLabel ( const Common::String source) const

Action-bar / HUD chrome; German source key, same lookup rules as hotspot labels.

◆ getMcsDirectoryOffset()

uint32 Macs2::Macs2Engine::getMcsDirectoryOffset ( ) const
inline

MCS directory base.

◆ screenHeight()

int Macs2::Macs2Engine::screenHeight ( )
inline

Full framebuffer height (playfield + bottom HUD / Scumm strip). Matches initGraphics height used at startup.

◆ isBottomHudVisible()

bool Macs2::Macs2Engine::isBottomHudVisible ( ) const
inline

Bottom HUD / action-bar visibility (dialect-neutral). hide/show opcodes toggle MenuMode Hidden vs Main and restore the cursor saved on hide. The Scumm kEnhUIUX strip uses the same flag; cursor mode alone never hides the bar.

◆ hasNativeHudAssets()

bool Macs2::Macs2Engine::hasNativeHudAssets ( ) const
inline

True when dialect-v2 panel geometry/assets are available for native HUD.

◆ timerTickMs()

uint32 Macs2::Macs2Engine::timerTickMs ( ) const
inline

Game-loop timer quantum in milliseconds.

◆ ticksPerGameFrame()

uint16 Macs2::Macs2Engine::ticksPerGameFrame ( ) const
inline

Normal-speed: game frames per that many timer ticks.

◆ maxAnimSlots()

uint16 Macs2::Macs2Engine::maxAnimSlots ( ) const
inline

ReadyObject anim slots (1-based inclusive max).

◆ maxOrientations()

uint16 Macs2::Macs2Engine::maxOrientations ( ) const
inline

Orientations that map to anim slots 1..N (inclusive).

◆ overloadAnimSlot()

uint16 Macs2::Macs2Engine::overloadAnimSlot ( ) const
inline

Overload / special-anim slot index.

◆ maxHotspots()

uint16 Macs2::Macs2Engine::maxHotspots ( ) const
inline

Scene hotspot override table entries (1-based inclusive max). Hotspot remap table indices (1-based). DOS scene+0x5BD1: 16; V2 ActModule+0x6161: 32.

◆ maxObjectResources()

uint Macs2::Macs2Engine::maxObjectResources ( ) const
inline

Per-object resource offset table entries.

◆ resolveAnimSlotIndex()

uint16 Macs2::Macs2Engine::resolveAnimSlotIndex ( const GameObject obj) const

Anim slot used for the current orientation (overload-direction rule).

◆ scriptValuesHaveHighWord()

bool Macs2::Macs2Engine::scriptValuesHaveHighWord ( ) const
inline

Script stream: literals carry an extra high word after the value word.

◆ scriptVarIndexHasPaddingWord()

bool Macs2::Macs2Engine::scriptVarIndexHasPaddingWord ( ) const
inline

Script stream: variable index is followed by a padding word.

◆ scaleScriptCoord()

int16 Macs2::Macs2Engine::scaleScriptCoord ( int16  coord) const
inline

Script coordinates -> screen/runtime coordinates (x2 on v2).

◆ dialogPadW()

int Macs2::Macs2Engine::dialogPadW ( ) const
inline

Dialogue / text-box chrome (DOS l0037_B368 / B462).

◆ dialogLineHeight()

int Macs2::Macs2Engine::dialogLineHeight ( ) const
inline

Per-line step for dialogue layout. DOS: maxGlyphHeight + dialogLineGap(). Amiga: absolute MXFF pitch (amigaTextLinePitch) or maxGlyphHeight when pitch is unset.

◆ depthThresholdForY()

uint8 Macs2::Macs2Engine::depthThresholdForY ( int16  charY) const
inline

Depth-map compare Y for sprite occlusion (halved on v2 full-res depth).

◆ loadBootstrapResources()

void Macs2::Macs2Engine::loadBootstrapResources ( )

Resource bootstrap (MCS or Amiga DataA/Mdir).

◆ loadSceneGraphics()

bool Macs2::Macs2Engine::loadSceneGraphics ( uint32  sceneIndex)

Load scene background, maps, pathfinding, and related scene tables. Called from changeScene; Amiga uses native MXMM from DataA.

◆ loadSceneGraphicsV1()

bool Macs2::Macs2Engine::loadSceneGraphicsV1 ( uint32  sceneIndex)

AHFFMACS0100 scene package (RLE maps).

◆ loadSceneGraphicsV2()

bool Macs2::Macs2Engine::loadSceneGraphicsV2 ( uint32  sceneIndex)

AHFFMACS0200 ReadyModule scene package (MegaPic + half-res masks).

◆ getGameId()

Common::String Macs2::Macs2Engine::getGameId ( ) const

Returns the game Id

◆ hasFeature()

bool Macs2::Macs2Engine::hasFeature ( EngineFeature  f) const
inlineoverridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ syncSoundSettings()

void Macs2::Macs2Engine::syncSoundSettings ( )
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).

Note
When setting volume levels, respect the "mute" config entry.
The volume for the plain sound type is reset to the maximum volume. If the engine can associate its own value for this type, it needs to overwrite this member and set it accordingly.

Reimplemented from Engine.

◆ canLoadGameStateCurrently()

bool Macs2::Macs2Engine::canLoadGameStateCurrently ( Common::U32String msg = nullptr)
inlineoverridevirtual

Indicate whether a game state can be loaded.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ canSaveGameStateCurrently()

bool Macs2::Macs2Engine::canSaveGameStateCurrently ( Common::U32String msg = nullptr)
inlineoverridevirtual

Indicate whether a game state can be saved.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ loadGameState()

Common::Error Macs2::Macs2Engine::loadGameState ( int  slot)
overridevirtual

Load a game state.

Parameters
slotThe slot from which a save state should be loaded.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ syncGame()

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.

◆ saveGameStream()

Common::Error Macs2::Macs2Engine::saveGameStream ( Common::WriteStream stream,
bool  isAutosave = false 
)
inlineoverridevirtual

Save a game state.

Parameters
streamThe write stream to save the savegame data to.
isAutosaveExpected to be true if an autosave is being created.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ loadGameStream()

Common::Error Macs2::Macs2Engine::loadGameStream ( Common::SeekableReadStream stream)
inlineoverridevirtual

Load a game state.

Parameters
streamThe stream to load the save state from.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ tick()

bool Macs2::Macs2Engine::tick ( )
overridevirtual

Called once every game frame

Reimplemented from Macs2::Events.

◆ getHotspotPositions()

void Macs2::Macs2Engine::getHotspotPositions ( Common::Array< Graphics::HotspotInfo > &  hotspots)
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.

Parameters
hotspotsArray to be filled with hotspot information

Reimplemented from Engine.

◆ hotspotDirty()

bool Macs2::Macs2Engine::hotspotDirty ( ) const
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.

Returns
true if hotspots should be re-rendered, false to skip

Reimplemented from Engine.

Member Data Documentation

◆ _cursorHotspots

Common::Point Macs2::Macs2Engine::_cursorHotspots[33]

Per-cursor hotspot from native HUD button metadata (v2); (0,0) = use center.

◆ _mcsDirectoryOffset

uint32 Macs2::Macs2Engine::_mcsDirectoryOffset = kMcsV1DirectoryOffset

Absolute file offset of the 0x3000-byte scene/object directory.

◆ _amigaNativePlayfieldPalette

bool Macs2::Macs2Engine::_amigaNativePlayfieldPalette = false

True after loadAmigaSceneBackground installed copper colors in 0..31.

◆ _amigaArchive

Macs2AmigaArchive* Macs2::Macs2Engine::_amigaArchive = nullptr

Amiga DataA/Mdir archive (owned). Null on DOS.

◆ _amigaPendingSceneScript

Common::Array<byte> Macs2::Macs2Engine::_amigaPendingSceneScript

Filled by loadAmigaSceneBackground; consumed by Amiga changeScene.

◆ _ttsPreviousSaid

Common::String Macs2::Macs2Engine::_ttsPreviousSaid
mutable

Last string submitted to TTS; skips per-frame INTERRUPT restarts.

◆ _bottomHudVisible

bool Macs2::Macs2Engine::_bottomHudVisible = true

Bottom HUD visible (showActionBar/hideActionBar); default shown.

◆ _hudMegapics

Graphics::ManagedSurface Macs2::Macs2Engine::_hudMegapics[6]

Native persistent HUD button table and megapic panels. Populated when dialect-v2 panel assets are loaded.

◆ _panelTopY

uint16 Macs2::Macs2Engine::_panelTopY = 0

Y where the bottom HUD starts; scene above this is interactive.

◆ _hudTextLayout

uint16 Macs2::Macs2Engine::_hudTextLayout[7] = {}

Text layout after invent grid: [0..4] = options list X/Y/maxW/rows/pitch [5..6] = dialogue list X/Y

◆ _skipSpeed

uint16 Macs2::Macs2Engine::_skipSpeed = 1

Cutscene skip-speed preference (1..4) from options HUD.

◆ _talkVol

uint16 Macs2::Macs2Engine::_talkVol = 0

TalkVol / setWaveVolume percent (0..100). Used to duck SMF while speech plays. 0 means unset (duck uses a 50% default).

◆ _currentSoundHandle

Audio::SoundHandle Macs2::Macs2Engine::_currentSoundHandle

One-shot PCM / SOUNDFX WAV (script SFX).

◆ _speechSoundHandle

Audio::SoundHandle Macs2::Macs2Engine::_speechSoundHandle

Optional SPEECH WAV dialogue (independent of environment SFX).


The documentation for this class was generated from the following file: