ScummVM API documentation
Engine Class Referenceabstract
Inheritance diagram for Engine:
Access::AccessEngine Adl::AdlEngine Agi::AgiBase AGOS::AGOSEngine Avalanche::AvalancheEngine Bbvs::BbvsEngine BladeRunner::BladeRunnerEngine CGE2::CGE2Engine CGE::CGEEngine Chewy::ChewyEngine Cine::CineEngine Composer::ComposerEngine Cruise::CruiseEngine Cryo::CryoEngine CryOmni3D::CryOmni3DEngine Director::DirectorEngine DM::DMEngine Draci::DraciEngine Dragons::DragonsEngine Drascula::DrasculaEngine DreamWeb::DreamWebEngine Gnap::GnapEngine Gob::GobEngine Griffon::GriffonEngine Grim::GrimEngine Groovie::GroovieEngine Hadesch::HadeschEngine HDB::HDBGame Hopkins::HopkinsEngine Hugo::HugoEngine ICB::IcbEngine Illusions::IllusionsEngine Kingdom::KingdomGame Kyra::KyraEngine_v1 Lab::LabEngine LastExpress::LastExpressEngine Lilliput::LilliputEngine Lure::LureEngine MacVenture::MacVentureEngine Made::MadeEngine MADS::MADSEngine Mohawk::MohawkEngine Mortevielle::MortevielleEngine MutationOfJB::MutationOfJBEngine Myst3::Myst3Engine Neverhood::NeverhoodEngine NGI::NGIEngine Parallaction::Parallaction Pegasus::PegasusEngine Petka::PetkaEngine Pink::PinkEngine Plumbers::PlumbersGame Prince::PrinceEngine Queen::QueenEngine Saga::SagaEngine Sci::SciEngine Scumm::ScummEngine Sherlock::SherlockEngine Sky::SkyEngine Sludge::SludgeEngine Stark::StarkEngine StarTrek::StarTrekEngine Supernova::SupernovaEngine Sword1::SwordEngine Sword25::Sword25Engine Sword2::Sword2Engine TeenAgent::TeenAgentEngine Testbed::TestbedEngine Tinsel::TinselEngine Titanic::TitanicEngine Toltecs::ToltecsEngine Toon::ToonEngine Touche::ToucheEngine TsAGE::TSageEngine Tucker::TuckerEngine TwinE::TwinEEngine Ultima::Shared::UltimaEngine Voyeur::VoyeurEngine Wage::WageEngine Wintermute::WintermuteEngine Xeen::XeenEngine ZVision::ZVision

Public Types

enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions
}
 

Public Member Functions

PauseToken pauseEngine ()
 
bool isPaused () const
 
void openMainMenuDialog ()
 
uint32 getTotalPlayTime () const
 
void setTotalPlayTime (uint32 time=0)
 
Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
Common::SaveFileManagergetSaveFileManager ()
 
void checkCD ()
 
void handleAutoSave ()
 
void saveAutosaveIfEnabled ()
 
virtual bool canSaveAutosaveCurrently ()
 
virtual int getAutosaveSlot () const
 
bool shouldPerformAutoSave (int lastSaveTime)
 

Static Public Member Functions

static void quitGame ()
 
static bool shouldQuit ()
 
static MetaEngineDetectiongetMetaEngineDetection ()
 
static MetaEnginegetMetaEngine ()
 
static bool warnUserAboutUnsupportedGame ()
 
static void errorUnsupportedGame (Common::String extraMsg)
 

Public Attributes

OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

virtual int runDialog (GUI::Dialog &dialog)
 

Protected Attributes

Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Overloadable methods

All Engine subclasses should consider overloading some or all of the following methods.

virtual void pauseEngineIntern (bool pause)
 
 Engine (OSystem *syst)
 
virtual ~Engine ()
 
virtual void initializePath (const Common::FSNode &gamePath)
 
virtual Common::Error run ()=0
 
virtual void errorString (const char *buf_input, char *buf_output, int buf_output_size)
 
virtual GUI::DebuggergetDebugger ()
 
void setDebugger (GUI::Debugger *debugger)
 
GUI::DebuggergetOrCreateDebugger ()
 
virtual bool hasFeature (EngineFeature f) const
 
virtual void syncSoundSettings ()
 
virtual void applyGameSettings ()
 
virtual void flipMute ()
 
virtual Common::String getSaveStateName (int slot) const
 
virtual Common::Error loadGameState (int slot)
 
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 
void setGameToLoadSlot (int slot)
 
virtual bool canLoadGameStateCurrently ()
 
virtual Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false)
 
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 
virtual bool canSaveGameStateCurrently ()
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 

Member Enumeration Documentation

◆ EngineFeature

Engine features.

A feature in this context means an ability of the engine that can be either available or not.

See also
Engine::hasFeature()
Enumerator
kSupportsSubtitleOptions 

Enable the subtitle speed and toggle items in the Options section of the global main menu.

kSupportsReturnToLauncher 

The 'Return to launcher' feature is supported.

This means that EVENT_RETURN_TO_LAUNCHER is handled either directly, or indirectly (the engine calls and honors the result of the Engine::shouldQuit() method appropriately).

kSupportsLoadingDuringRuntime 

Loading save states during runtime is supported.

This means that the engine implements loadGameState() and canLoadGameStateCurrently(). If this feature is supported, then the corresponding MetaEngine must support the kSupportsListSaves feature.

kSupportsSavingDuringRuntime 

Loading save states during runtime is supported.

This means that the engine implements saveGameState() and canSaveGameStateCurrently(). If this feature is supported, then the corresponding MetaEngine must support the kSupportsListSaves feature.

kSupportsChangingOptionsDuringRuntime 

Changing the game settings during runtime is supported.

This enables showing the Engine Options tab in the config dialog accessed through the global main menu.

kSupportsArbitraryResolutions 

Arbitrary resolutions are supported.

This means that the engine allows the backend to override the resolution passed to OSystem::setupScreen. The engine will need to read the actual resolution used by the backend using OSystem::getWidth and OSystem::getHeight.

Constructor & Destructor Documentation

◆ Engine()

Engine::Engine ( OSystem syst)

Create an instance of the engine.

◆ ~Engine()

virtual Engine::~Engine ( )
virtual

Destroy the engine instance.

Member Function Documentation

◆ runDialog()

virtual int Engine::runDialog ( GUI::Dialog dialog)
protectedvirtual

Run a GUI dialog.

◆ initializePath()

virtual void Engine::initializePath ( const Common::FSNode gamePath)
virtual

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 in CryOmni3D::Versailles::CryOmni3DEngine_Versailles, HDB::HDBGame, Tinsel::TinselEngine, and Titanic::TitanicEngine.

◆ run()

virtual Common::Error Engine::run ( )
pure virtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implemented in Mohawk::MohawkEngine_LivingBooks, Agi::AgiBase, Touche::ToucheEngine, Tucker::TuckerEngine, Mortevielle::MortevielleEngine, Saga::SagaEngine, Lilliput::LilliputEngine, Griffon::GriffonEngine, Scumm::ScummEngine, Drascula::DrasculaEngine, Hugo::HugoEngine, BladeRunner::BladeRunnerEngine, Prince::PrinceEngine, Director::DirectorEngine, Dragons::DragonsEngine, Parallaction::Parallaction, StarTrek::StarTrekEngine, CryOmni3D::Versailles::CryOmni3DEngine_Versailles, Gnap::GnapEngine, Bbvs::BbvsEngine, Kyra::KyraEngine_v1, AGOS::AGOSEngine, CGE::CGEEngine, Pegasus::PegasusEngine, Lab::LabEngine, MacVenture::MacVentureEngine, TwinE::TwinEEngine, DM::DMEngine, ZVision::ZVision, Ultima::Ultima8::Ultima8Engine, CGE2::CGE2Engine, Voyeur::VoyeurEngine, Composer::ComposerEngine, HDB::HDBGame, Sword2::Sword2Engine, Sci::SciEngine, Sherlock::SherlockEngine, Tinsel::TinselEngine, Mohawk::MohawkEngine_CSTime, Mohawk::MohawkEngine_Myst, Hopkins::HopkinsEngine, Avalanche::AvalancheEngine, Queen::QueenEngine, Wage::WageEngine, Sky::SkyEngine, NGI::NGIEngine, Access::AccessEngine, Toon::ToonEngine, Hadesch::HadeschEngine, DreamWeb::DreamWebEngine, Titanic::TitanicEngine, Cine::CineEngine, Groovie::GroovieEngine, Sword1::SwordEngine, Toltecs::ToltecsEngine, Lure::LureEngine, Ultima::Shared::UltimaEarlyEngine, Kingdom::KingdomGame, Mohawk::MohawkEngine_Riven, Pink::PinkEngine, Myst3::Myst3Engine, Petka::PetkaEngine, TeenAgent::TeenAgentEngine, MADS::MADSEngine, Plumbers::PlumbersGame, CryOmni3D::CryOmni3DEngine, Illusions::IllusionsEngine_Duckman, Stark::StarkEngine, Sword25::Sword25Engine, Ultima::Nuvie::NuvieEngine, Cruise::CruiseEngine, LastExpress::LastExpressEngine, Chewy::ChewyEngine, Sludge::SludgeEngine, Supernova::SupernovaEngine, Illusions::IllusionsEngine_BBDOU, MutationOfJB::MutationOfJBEngine, TsAGE::TSageEngine, Draci::DraciEngine, Grim::GrimEngine, Ultima::Ultima4::Ultima4Engine, Cryo::CryoEngine, Made::MadeEngine, Neverhood::NeverhoodEngine, Wintermute::WintermuteEngine, Mohawk::MohawkEngine, Testbed::TestbedEngine, and ICB::IcbEngine.

◆ errorString()

virtual void Engine::errorString ( const char *  buf_input,
char *  buf_output,
int  buf_output_size 
)
virtual

Prepare an error string that is printed by the error() function.

Reimplemented in Scumm::ScummEngine.

◆ getDebugger()

virtual GUI::Debugger* Engine::getDebugger ( )
inlinevirtual

Return the engine's debugger instance, if any.

◆ setDebugger()

void Engine::setDebugger ( GUI::Debugger debugger)
inline

Set the engine's debugger.

Once set, the Engine class is responsible for managing the debugger, and freeing it on exit.

◆ getOrCreateDebugger()

GUI::Debugger* Engine::getOrCreateDebugger ( )

Return the engine's debugger instance, or create one if none is present.

Used by error() to invoke the debugger when a severe error is reported.

◆ hasFeature()

virtual bool Engine::hasFeature ( EngineFeature  f) const
inlinevirtual

Determine whether the engine supports the specified feature.

Reimplemented in Agi::AgiBase, Touche::ToucheEngine, Tucker::TuckerEngine, Mortevielle::MortevielleEngine, Saga::SagaEngine, NGI::NGIEngine, Scumm::ScummEngine, Toon::ToonEngine, Drascula::DrasculaEngine, Lilliput::LilliputEngine, BladeRunner::BladeRunnerEngine, Prince::PrinceEngine, Hugo::HugoEngine, Parallaction::Parallaction, ZVision::ZVision, Dragons::DragonsEngine, CryOmni3D::Versailles::CryOmni3DEngine_Versailles, Kyra::KyraEngine_v1, Gnap::GnapEngine, Bbvs::BbvsEngine, AGOS::AGOSEngine, Lab::LabEngine, Director::DirectorEngine, Mohawk::MohawkEngine_Myst, MacVenture::MacVentureEngine, TwinE::TwinEEngine, Grim::GrimEngine, DM::DMEngine, Composer::ComposerEngine, Voyeur::VoyeurEngine, CGE2::CGE2Engine, Sword2::Sword2Engine, HDB::HDBGame, Sci::SciEngine, CGE::CGEEngine, Tinsel::TinselEngine, Hopkins::HopkinsEngine, Sky::SkyEngine, Queen::QueenEngine, Mohawk::MohawkEngine_Riven, Wage::WageEngine, Access::AccessEngine, Myst3::Myst3Engine, Hadesch::HadeschEngine, DreamWeb::DreamWebEngine, Sword1::SwordEngine, Titanic::TitanicEngine, Avalanche::AvalancheEngine, Toltecs::ToltecsEngine, Groovie::GroovieEngine, Lure::LureEngine, Cine::CineEngine, Sherlock::SherlockEngine, CryOmni3D::CryOmni3DEngine, Pink::PinkEngine, TeenAgent::TeenAgentEngine, Petka::PetkaEngine, MADS::MADSEngine, Illusions::IllusionsEngine_Duckman, Cruise::CruiseEngine, Pegasus::PegasusEngine, Stark::StarkEngine, Sword25::Sword25Engine, LastExpress::LastExpressEngine, Ultima::Shared::UltimaEngine, Mohawk::MohawkEngine, Chewy::ChewyEngine, Supernova::SupernovaEngine, Neverhood::NeverhoodEngine, MutationOfJB::MutationOfJBEngine, Illusions::IllusionsEngine_BBDOU, Made::MadeEngine, Draci::DraciEngine, Testbed::TestbedEngine, Wintermute::WintermuteEngine, and TsAGE::TSageEngine.

◆ syncSoundSettings()

virtual void Engine::syncSoundSettings ( )
virtual

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 in Agi::AgiEngine, Touche::ToucheEngine, Saga::SagaEngine, Griffon::GriffonEngine, Scumm::ScummEngine, Drascula::DrasculaEngine, BladeRunner::BladeRunnerEngine, Lilliput::LilliputEngine, Ultima::Ultima8::Ultima8Engine, Xeen::XeenEngine, Dragons::DragonsEngine, Hugo::HugoEngine, ZVision::ZVision, AGOS::AGOSEngine, Kyra::KyraEngine_v1, Hopkins::HopkinsEngine, Sherlock::SherlockEngine, Titanic::TitanicEngine, Sci::SciEngine, Sword2::Sword2Engine, MADS::MADSEngine, Queen::QueenEngine, Cine::CineEngine, Toltecs::ToltecsEngine, Groovie::GroovieEngine, Sword1::SwordEngine, Lure::LureEngine, Cruise::CruiseEngine, Sky::SkyEngine, Myst3::Myst3Engine, Ultima::Nuvie::NuvieEngine, TsAGE::TSageEngine, Made::MadeEngine, and Draci::DraciEngine.

◆ applyGameSettings()

virtual void Engine::applyGameSettings ( )
inlinevirtual

Notify the engine that the settings editable from the Game tab in the in-game options dialog might have changed and that they need to be applied if necessary.

Reimplemented in Mohawk::MohawkEngine_Myst, and Mohawk::MohawkEngine_Riven.

◆ flipMute()

virtual void Engine::flipMute ( )
virtual

Flip mute all sound options.

◆ getSaveStateName()

◆ loadGameState()

virtual Common::Error Engine::loadGameState ( int  slot)
virtual

Load a game state.

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

Reimplemented in Agi::AgiEngine, Tucker::TuckerEngine, Kyra::KyraEngine_HoF, Touche::ToucheEngine, Saga::SagaEngine, Mortevielle::MortevielleEngine, Bbvs::BbvsEngine, Kyra::KyraEngine_v1, NGI::NGIEngine, Scumm::ScummEngine, Drascula::DrasculaEngine, Toon::ToonEngine, Gnap::GnapEngine, Ultima::Ultima8::Ultima8Engine, BladeRunner::BladeRunnerEngine, Access::AccessEngine, Prince::PrinceEngine, Hugo::HugoEngine, ZVision::ZVision, Dragons::DragonsEngine, Adl::AdlEngine, Xeen::XeenEngine, CryOmni3D::Versailles::CryOmni3DEngine_Versailles, Kingdom::KingdomGame, Illusions::IllusionsEngine, Lab::LabEngine, Toltecs::ToltecsEngine, Kyra::KyraEngine_LoK, Wage::WageEngine, Voyeur::VoyeurEngine, MacVenture::MacVentureEngine, HDB::HDBGame, Mohawk::MohawkEngine_Myst, DM::DMEngine, Sword2::Sword2Engine, Hopkins::HopkinsEngine, CGE2::CGE2Engine, Composer::ComposerEngine, Sherlock::SherlockEngine, Sci::SciEngine, Titanic::TitanicEngine, CGE::CGEEngine, Tinsel::TinselEngine, MADS::MADSEngine, Cine::CineEngine, Lure::LureEngine, Myst3::Myst3Engine, Neverhood::NeverhoodEngine, DreamWeb::DreamWebEngine, Avalanche::AvalancheEngine, Mohawk::MohawkEngine_Riven, Sword1::SwordEngine, Groovie::GroovieEngine, Petka::PetkaEngine, Sky::SkyEngine, Queen::QueenEngine, Ultima::Nuvie::NuvieEngine, Pink::PinkEngine, Cruise::CruiseEngine, TeenAgent::TeenAgentEngine, Grim::GrimEngine, Pegasus::PegasusEngine, Stark::StarkEngine, Draci::DraciEngine, MutationOfJB::MutationOfJBEngine, Supernova::SupernovaEngine, TsAGE::TSageEngine, and Wintermute::WintermuteEngine.

◆ loadGameStream()

virtual Common::Error Engine::loadGameStream ( Common::SeekableReadStream stream)
virtual

Load a game state.

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

Reimplemented in Ultima::Ultima8::Ultima8Engine, TwinE::TwinEEngine, Ultima::Shared::UltimaEarlyEngine, Ultima::Ultima4::Ultima4Engine, and Hadesch::HadeschEngine.

◆ setGameToLoadSlot()

void Engine::setGameToLoadSlot ( int  slot)

Set the game slot for a savegame to be loaded after the global main menu execution.

This is to avoid loading a savegame from inside the menu loop which causes bugs like #2822778.

Parameters
slotThe slot from which a save state should be loaded.

◆ canLoadGameStateCurrently()

virtual bool Engine::canLoadGameStateCurrently ( )
virtual

Indicate whether a game state can be loaded.

Reimplemented in Tucker::TuckerEngine, Agi::AgiBase, Touche::ToucheEngine, Saga::SagaEngine, Mortevielle::MortevielleEngine, Bbvs::BbvsEngine, NGI::NGIEngine, Kyra::KyraEngine_v1, Scumm::ScummEngine, Drascula::DrasculaEngine, Access::AccessEngine, BladeRunner::BladeRunnerEngine, Prince::PrinceEngine, Xeen::XeenEngine, Dragons::DragonsEngine, ZVision::ZVision, Hugo::HugoEngine, Lab::LabEngine, Illusions::IllusionsEngine, Toltecs::ToltecsEngine, Toon::ToonEngine, Voyeur::VoyeurEngine, HDB::HDBGame, MacVenture::MacVentureEngine, TwinE::TwinEEngine, Mohawk::MohawkEngine_Myst, DM::DMEngine, Sword2::Sword2Engine, Hopkins::HopkinsEngine, CGE2::CGE2Engine, Composer::ComposerEngine, Sci::SciEngine, Sherlock::SherlockEngine, Tinsel::TinselEngine, CGE::CGEEngine, Titanic::TitanicEngine, Lure::LureEngine, Cine::CineEngine, Ultima::Shared::UltimaEngine, MADS::MADSEngine, Myst3::Myst3Engine, Wage::WageEngine, DreamWeb::DreamWebEngine, Neverhood::NeverhoodEngine, Avalanche::AvalancheEngine, Hadesch::HadeschEngine, Sword1::SwordEngine, Mohawk::MohawkEngine_Riven, Petka::PetkaEngine, Sherlock::Tattoo::TattooEngine, Groovie::GroovieEngine, Sky::SkyEngine, CryOmni3D::CryOmni3DEngine, Pink::PinkEngine, Queen::QueenEngine, Cruise::CruiseEngine, TeenAgent::TeenAgentEngine, Grim::GrimEngine, Pegasus::PegasusEngine, Stark::StarkEngine, Draci::DraciEngine, MutationOfJB::MutationOfJBEngine, Supernova::SupernovaEngine, TsAGE::TSageEngine, and Wintermute::WintermuteEngine.

◆ saveGameState()

virtual Common::Error Engine::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave = false 
)
virtual

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 in Agi::AgiEngine, Tucker::TuckerEngine, Touche::ToucheEngine, Saga::SagaEngine, Mortevielle::MortevielleEngine, Bbvs::BbvsEngine, Kyra::KyraEngine_v1, NGI::NGIEngine, Scumm::ScummEngine, Drascula::DrasculaEngine, Toon::ToonEngine, Gnap::GnapEngine, Ultima::Ultima8::Ultima8Engine, Access::AccessEngine, BladeRunner::BladeRunnerEngine, Prince::PrinceEngine, Hugo::HugoEngine, ZVision::ZVision, Dragons::DragonsEngine, Xeen::XeenEngine, Adl::AdlEngine, CryOmni3D::Versailles::CryOmni3DEngine_Versailles, Kingdom::KingdomGame, Illusions::IllusionsEngine, Lab::LabEngine, Toltecs::ToltecsEngine, Wage::WageEngine, Voyeur::VoyeurEngine, MacVenture::MacVentureEngine, HDB::HDBGame, Mohawk::MohawkEngine_Myst, Hopkins::HopkinsEngine, Sword2::Sword2Engine, Sherlock::SherlockEngine, CGE2::CGE2Engine, Composer::ComposerEngine, Titanic::TitanicEngine, Sci::SciEngine, CGE::CGEEngine, MADS::MADSEngine, Cine::CineEngine, Lure::LureEngine, Myst3::Myst3Engine, Neverhood::NeverhoodEngine, DreamWeb::DreamWebEngine, Ultima::Ultima4::Ultima4Engine, Sword1::SwordEngine, Avalanche::AvalancheEngine, Mohawk::MohawkEngine_Riven, Petka::PetkaEngine, Groovie::GroovieEngine, Ultima::Nuvie::NuvieEngine, Sky::SkyEngine, Pink::PinkEngine, Queen::QueenEngine, Cruise::CruiseEngine, TeenAgent::TeenAgentEngine, Pegasus::PegasusEngine, Stark::StarkEngine, Draci::DraciEngine, MutationOfJB::MutationOfJBEngine, Supernova::SupernovaEngine, TsAGE::TSageEngine, and Wintermute::WintermuteEngine.

◆ saveGameStream()

virtual Common::Error Engine::saveGameStream ( Common::WriteStream stream,
bool  isAutosave = false 
)
virtual

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 in Ultima::Ultima8::Ultima8Engine, TwinE::TwinEEngine, Ultima::Ultima4::Ultima4Engine, Ultima::Shared::UltimaEarlyEngine, and Hadesch::HadeschEngine.

◆ canSaveGameStateCurrently()

virtual bool Engine::canSaveGameStateCurrently ( )
virtual

◆ saveGameDialog()

bool Engine::saveGameDialog ( )

Show the ScummVM save dialog, allowing users to save their game.

◆ loadGameDialog()

bool Engine::loadGameDialog ( )

Show the ScummVM Restore dialog, allowing users to load a game.

◆ pauseEngineIntern()

◆ quitGame()

static void Engine::quitGame ( )
static

Request the engine to quit.

Sends an EVENT_QUIT event to the Event Manager.

◆ shouldQuit()

static bool Engine::shouldQuit ( )
static

Return whether the engine should quit.

This can mean either quitting ScummVM altogether, or returning to the launcher.

◆ getMetaEngineDetection()

static MetaEngineDetection& Engine::getMetaEngineDetection ( )
static

Return the MetaEngineDetection instance used by this engine.

◆ getMetaEngine()

static MetaEngine& Engine::getMetaEngine ( )
static

Return the MetaEngine instance used by this engine.

◆ pauseEngine()

PauseToken Engine::pauseEngine ( )

Pause the engine.

This should stop any audio playback and other operations. Called right before the system runs a global dialog (like a global pause, main menu, options, or 'confirm exit' dialog).

Returns a PauseToken. Multiple pause tokens can exist. The engine will be resumed when all associated pause tokens reach the end of their lives.

◆ isPaused()

bool Engine::isPaused ( ) const
inline

Return whether the engine is currently paused or not.

◆ openMainMenuDialog()

void Engine::openMainMenuDialog ( )

Run the global main menu dialog.

◆ warnUserAboutUnsupportedGame()

static bool Engine::warnUserAboutUnsupportedGame ( )
static

Display a warning to the user that the game is not fully supported.

Returns
True if the user chooses to start anyway, false otherwise.

◆ errorUnsupportedGame()

static void Engine::errorUnsupportedGame ( Common::String  extraMsg)
static

Display an error message to the user that the game is not supported.

Parameters
extraMsgAn extra message that will be appended to the default message.

◆ getTotalPlayTime()

uint32 Engine::getTotalPlayTime ( ) const

Get the total play time.

Returns
How long the player has been playing in ms.

◆ setTotalPlayTime()

void Engine::setTotalPlayTime ( uint32  time = 0)

Set the game time counter to the specified time.

This can be used to set the play time counter after loading a savegame, for example. Another use case is when the engine wants to exclude from the counter the time that the user spent in original engine dialogs.

Parameters
timePlay time to set up in ms.

◆ getTimerManager()

Common::TimerManager* Engine::getTimerManager ( )
inline

Return the TimerManager instance used by this engine.

◆ getEventManager()

Common::EventManager* Engine::getEventManager ( )
inline

Return the EventManager instance used by this engine.

◆ getSaveFileManager()

Common::SaveFileManager* Engine::getSaveFileManager ( )
inline

Return the SaveFileManager instance used by this engine.

◆ checkCD()

void Engine::checkCD ( )

On some systems, check whether the game appears to be run from CD.

◆ handleAutoSave()

void Engine::handleAutoSave ( )

Check whether it is time to autosave, and if so, do it.

◆ saveAutosaveIfEnabled()

void Engine::saveAutosaveIfEnabled ( )

Autosave immediately if autosaves are enabled.

◆ canSaveAutosaveCurrently()

virtual bool Engine::canSaveAutosaveCurrently ( )
inlinevirtual

Indicate whether an autosave can currently be done.

Reimplemented in Tucker::TuckerEngine, Scumm::ScummEngine, Xeen::XeenEngine, and Mohawk::MohawkEngine_Riven.

◆ getAutosaveSlot()

virtual int Engine::getAutosaveSlot ( ) const
inlinevirtual

Return the slot that should be used for autosaves.

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

Reimplemented in Tucker::TuckerEngine, Kyra::KyraEngine_v1, and Queen::QueenEngine.

◆ shouldPerformAutoSave()

bool Engine::shouldPerformAutoSave ( int  lastSaveTime)
inline

Check whether it is time to autosave based on the provided lastSaveTime.

This function is now deprecated as autosaves are handled directly by the Engine class and derived classes do not need to worry about it other than to implement canSaveAutosaveCurrently() and getAutosaveSlot() if the default implementations are not sufficient.

Member Data Documentation

◆ _system

OSystem* Engine::_system

The OSystem instance used by the engine.

◆ _mixer

Audio::Mixer* Engine::_mixer

The Mixer instance used by the engine.

◆ _timer

Common::TimerManager* Engine::_timer
protected

The TimerManager instance used by the engine.

◆ _eventMan

Common::EventManager* Engine::_eventMan
protected

The EventManager instance used by the engine.

◆ _saveFileMan

Common::SaveFileManager* Engine::_saveFileMan
protected

The SaveFileMAnager used by the engine.

◆ _mainMenuDialog

GUI::Dialog* Engine::_mainMenuDialog
protected

The Dialog instance used by the engine.

◆ _targetName

const Common::String Engine::_targetName
protected

Target name for saves.


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