ScummVM API documentation
MADS::MADSEngine Class Referenceabstract
Inheritance diagram for MADS::MADSEngine:
Engine MADS::Dragonsphere::DragonsphereEngine MADS::Forest::ForestEngine MADS::Phantom::PhantomEngine MADS::RexNebular::RexNebularEngine MADS::RexNebular::BonusEngine

Public Member Functions

 MADSEngine (OSystem *syst, const MADSGameDescription *gameDesc)
 
void initializePath (const Common::FSNode &gamePath) override
 
uint32 getFeatures () const
 
Common::Language getLanguage () const
 
Common::Platform getPlatform () const
 
uint16 getVersion () const
 
uint32 getGameID () const
 
uint32 getGameFeatures () const
 
bool isDemo () const
 
bool isCDROM () const
 
void readConfigFile ()
 
int getRandomNumber (int maxNumber)
 
int getRandomNumber (int minNumber, int maxNumber)
 
Graphics::Screen * getScreen () const
 
bool hasPendingKey (bool presentScreen=true)
 
int getKey ()
 
void flushKeys ()
 
int getMouseState (int &x, int &y)
 
void warpMouse (int x, int y)
 
void updateDisplay ()
 
void pauseEngineIntern (bool pause) override
 
const Graphics::Surface & getSavegameThumbnail () const
 
void setSavegameThumbnail ()
 
void clearSavegameThumbnail ()
 
uint32 getMillis ()
 
int main_cheating_key (int mykey) const
 
int main_normal_key (int mykey) const
 
virtual int main_copy_verify ()
 
bool canLoadGameStateCurrently (Common::U32String *msg) override
 
bool canSaveGameStateCurrently (Common::U32String *msg) override
 
Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave) override
 
Common::Error loadGameStream (Common::SeekableReadStream *stream) override
 
virtual void syncRoom (Common::Serializer &s)=0
 
SaveStateList listSaves () const
 
virtual void global_init_code ()=0
 
virtual void section_music (int section_num)=0
 
virtual void global_section_constructor ()=0
 
virtual void global_daemon_code ()=0
 
virtual void global_pre_parser_code ()=0
 
virtual void global_parser_code ()=0
 
virtual void global_error_code ()=0
 
virtual void global_room_init ()=0
 
virtual void global_sound_driver ()=0
 
virtual void global_game_main_loop ()
 
virtual void global_verb_filter ()
 
int getMessageTextWidth (FontPtr font, const char *text, int spacing) const
 
virtual bool hasInterfaceAnimations () const
 
virtual bool drawPopup ()
 
virtual int editMacintoshPopup (char *, int)
 
virtual void onPopupDestroyed ()
 
virtual int getMacintoshTextWidth (FontPtr, const char *, int) const
 
virtual bool drawMacintoshText (FontPtr, Buffer *, const char *, int, int, int, int) const
 
virtual bool getInterfaceSentenceColor (byte &) const
 
virtual bool hasMacintoshInterface () const
 
virtual bool setMacintoshPalette (const RGBcolor *, int, int)
 
virtual bool getMacintoshPalette (RGBcolor *, int, int) const
 
virtual void player_keep_walking ()
 
void playSpeech (Audio::AudioStream *stream)
 
void stopSpeech ()
 
bool isSpeechPlaying () const
 
void syncSoundSettings () override
 
void setTimerFunction (TimerFunction fn)
 
- 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 Common::Error run ()=0
 
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) const
 
virtual void applyGameSettings ()
 
virtual void flipMute ()
 
virtual Common::String getSaveStateName (int slot) const
 
virtual Common::Error loadGameState (int slot)
 
void setGameToLoadSlot (int slot)
 
virtual Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false)
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 

Public Attributes

MADS::SoundManager * _soundManager = nullptr
 
bool _musicFlag = true
 
bool _soundFlag = true
 
bool & _speechFlag = speech_on
 
- Public Attributes inherited from Engine
OSystem * _system
 
Audio::Mixer * _mixer
 

Protected Member Functions

virtual Common::Point screenToGame (const Common::Point &point) const
 
virtual Common::Point gameToScreen (const Common::Point &point) const
 
virtual void presentScreen (int shakeOffset)
 
virtual bool handleMacEvent (Common::Event &event)
 
virtual void serviceMacintoshUI ()
 
virtual void serviceMacintoshSound ()
 
bool hasFeature (EngineFeature f) const override
 
void pollEvents (bool presentScreen=true)
 
void checkForTimerFunction ()
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
void defaultSyncSoundSettings ()
 
virtual void getHotspotPositions (Common::Array< Graphics::HotspotInfo > &hotspots)
 
virtual void drawHotspots ()
 
virtual bool hotspotDirty () const
 

Protected Attributes

const MADSGameDescription * _gameDescription
 
Common::RandomSource _randomSource
 
Graphics::Screen * _screen = nullptr
 
Common::Stack< Common::KeyState > _keyEvents
 
uint32 _nextFrameTime = 0
 
Common::Point _mousePos
 
int _mouseButtons = 0
 
Audio::SoundHandle _speechHandle
 
TimerFunction _timerFunction = nullptr
 
uint32 _nextTimerTime = 0
 
Graphics::Surface _savegameThumbnail
 
- 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
 

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions , kSupportsReturnToLauncher , kSupportsLoadingDuringRuntime , kSupportsSavingDuringRuntime ,
  kSupportsChangingOptionsDuringRuntime , kSupportsArbitraryResolutions , kSupportsHelp , kSupportsQuitDialogOverride
}
 
- 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)
 

Member Function Documentation

◆ hasFeature()

bool MADS::MADSEngine::hasFeature ( EngineFeature  f) const
overrideprotectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Reimplemented in MADS::RexNebular::BonusEngine.

◆ initializePath()

void MADS::MADSEngine::initializePath ( const Common::FSNode &  gamePath)
overridevirtual

Initialize SearchMan according to the game path.

By default, this adds the directory in non-flat mode with a depth of 4 as priority 0 to SearchMan.

Parameters
gamePathThe base directory of the game data.

Reimplemented from Engine.

◆ pauseEngineIntern()

void MADS::MADSEngine::pauseEngineIntern ( bool  pause)
overridevirtual

Actual implementation of pauseEngine by subclasses.

See also
Engine::pauseEngine

Reimplemented from Engine.

◆ getMillis()

uint32 MADS::MADSEngine::getMillis ( )

Get the elapsed time in milliseconds

◆ canLoadGameStateCurrently()

bool MADS::MADSEngine::canLoadGameStateCurrently ( Common::U32String *  msg)
overridevirtual

Indicate whether a game state can be loaded.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ canSaveGameStateCurrently()

bool MADS::MADSEngine::canSaveGameStateCurrently ( Common::U32String *  msg)
inlineoverridevirtual

Indicate whether a game state can be saved.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ saveGameStream()

Common::Error MADS::MADSEngine::saveGameStream ( Common::WriteStream *  stream,
bool  isAutosave 
)
overridevirtual

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 MADS::MADSEngine::loadGameStream ( Common::SeekableReadStream *  stream)
overridevirtual

Load a game state.

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

Reimplemented from Engine.

◆ syncSoundSettings()

void MADS::MADSEngine::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.

◆ setTimerFunction()

void MADS::MADSEngine::setTimerFunction ( TimerFunction  fn)
inline

Sets the timer function to call at 60Hz


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