ScummVM API documentation
Asylum::AsylumEngine Class Reference
Inheritance diagram for Asylum::AsylumEngine:
Engine Common::Serializable

Public Types

enum  StartGameType { kStartGamePlayIntro, kStartGameLoad, kStartGameScene }
 
- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions, kSupportsHelp, kSupportsQuitDialogOverride
}
 

Public Member Functions

 AsylumEngine (OSystem *system, const ADGameDescription *gd)
 
bool startGame (ResourcePackId sceneId, StartGameType type)
 
void restart ()
 
void handleEvents ()
 
void switchScene (ResourcePackId sceneId)
 
uint32 getTick ()
 
void setTick (uint32 offset)
 
void reset ()
 
Cursorcursor ()
 
Encounterencounter ()
 
Menumenu ()
 
ResourceManagerresource ()
 
Savegamesavegame ()
 
Scenescene ()
 
Screenscreen ()
 
ScriptManagerscript ()
 
Specialspecial ()
 
Speechspeech ()
 
Soundsound ()
 
Texttext ()
 
VideoPlayervideo ()
 
SharedDatadata ()
 
Puzzlespuzzles ()
 
void setGameFlag (GameFlag flag)
 
void clearGameFlag (GameFlag flag)
 
void toggleGameFlag (GameFlag flag)
 
bool isGameFlagSet (GameFlag flag) const
 
bool isGameFlagNotSet (GameFlag flag) const
 
bool areGameFlagsSet (uint from, uint to) const
 
void resetFlags ()
 
uint getRandom (uint max)
 
uint getRandomBit ()
 
bool rectContains (const int16(*rectPtr)[4], const Common::Point &p) const
 
void unlockAchievement (const Common::String &id)
 
void checkAchievements ()
 
void switchEventHandler (EventHandler *handler)
 
void notify (AsylumEventType type, int32 param1=0, int32 param2=0)
 
void updateReverseStereo ()
 
void saveLoadWithSerializer (Common::Serializer &s) override
 
bool checkGameVersion (const char *version)
 
bool isAltDemo ()
 
Common::Language getLanguage ()
 
Common::String getTargetName ()
 
Common::String getMoviesFileName ()
 
bool isMenuVisible ()
 
EventHandlergetEventHandler ()
 
int getAutosaveSlot () const override
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
Common::Error loadGameState (int slot) override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
bool canSaveAutosaveCurrently () override
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 
- Public Member Functions inherited from Engine
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 ()
 
 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 ()
 
virtual void syncSoundSettings ()
 
virtual void applyGameSettings ()
 
virtual void flipMute ()
 
virtual Common::String getSaveStateName (int slot) const
 
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 
void setGameToLoadSlot (int slot)
 
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 

Public Attributes

uint32 screenUpdateCount
 
uint32 lastScreenUpdate
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

virtual Common::Error run () override
 
virtual bool hasFeature (EngineFeature f) const override
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
void defaultSyncSoundSettings ()
 
virtual void pauseEngineIntern (bool pause)
 

Additional Inherited Members

- Static Public Member Functions inherited from Engine
static void quitGame ()
 
static bool shouldQuit ()
 
static MetaEngineDetectiongetMetaEngineDetection ()
 
static bool warnUserAboutUnsupportedGame (Common::String msg=Common::String())
 
static void errorUnsupportedGame (Common::String extraMsg)
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Member Function Documentation

◆ run()

virtual Common::Error Asylum::AsylumEngine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ hasFeature()

virtual bool Asylum::AsylumEngine::hasFeature ( EngineFeature  f) const
overrideprotectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ startGame()

bool Asylum::AsylumEngine::startGame ( ResourcePackId  sceneId,
StartGameType  type 
)

Start a new the game

◆ restart()

void Asylum::AsylumEngine::restart ( )

Restarts the game

◆ handleEvents()

void Asylum::AsylumEngine::handleEvents ( )

Run event loop

◆ switchScene()

void Asylum::AsylumEngine::switchScene ( ResourcePackId  sceneId)
inline

Switch to a new scene

Parameters
sceneIdResourcePack for the scene

◆ getTick()

uint32 Asylum::AsylumEngine::getTick ( )
inline

Get the number of engine ticks

Returns
The tick.

◆ setTick()

void Asylum::AsylumEngine::setTick ( uint32  offset)
inline

Sets the tick value

Parameters
offsetThe offset.

◆ reset()

void Asylum::AsylumEngine::reset ( )

Resets the game

◆ switchEventHandler()

void Asylum::AsylumEngine::switchEventHandler ( EventHandler handler)

Switch message handler.

Parameters
handlerIf non-null, a pointer to an EventHandler class.

◆ notify()

void Asylum::AsylumEngine::notify ( AsylumEventType  type,
int32  param1 = 0,
int32  param2 = 0 
)

Notifies the current event handler of an event

Parameters
typeThe event type.

◆ updateReverseStereo()

void Asylum::AsylumEngine::updateReverseStereo ( )

Updates the reverse stereo scene status from the config

◆ getAutosaveSlot()

int Asylum::AsylumEngine::getAutosaveSlot ( ) const
inlineoverridevirtual

Return the slot that should be used for autosaves, or -1 for engines that don't support autosave.

Note
This should match the meta engine getAutosaveSlot() method.

Reimplemented from Engine.

◆ canLoadGameStateCurrently()

bool Asylum::AsylumEngine::canLoadGameStateCurrently ( Common::U32String msg = nullptr)
overridevirtual

Indicate whether a game state can be loaded.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ loadGameState()

Common::Error Asylum::AsylumEngine::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.

◆ canSaveGameStateCurrently()

bool Asylum::AsylumEngine::canSaveGameStateCurrently ( Common::U32String msg = nullptr)
overridevirtual

Indicate whether a game state can be saved.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ canSaveAutosaveCurrently()

bool Asylum::AsylumEngine::canSaveAutosaveCurrently ( )
overridevirtual

Indicate whether an autosave can currently be done.

Reimplemented from Engine.

◆ saveGameState()

Common::Error Asylum::AsylumEngine::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave = false 
)
overridevirtual

Save a game state.

Parameters
slotThe slot into which the save state should be stored.
descDescription for the save state, entered by the user.
isAutosaveExpected to be true if an autosave is being created.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

Member Data Documentation

◆ screenUpdateCount

uint32 Asylum::AsylumEngine::screenUpdateCount

This is the global tick counter.


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