◆ 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.
|
◆ Engine()
Engine::Engine |
( |
OSystem * |
syst | ) |
|
Initialize the OSystem for this engine.
◆ ~Engine()
virtual Engine::~Engine |
( |
| ) |
|
|
virtual |
◆ runDialog()
virtual int Engine::runDialog |
( |
GUI::Dialog & |
dialog | ) |
|
|
protectedvirtual |
Run the main menu 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
-
gamePath | The base directory of the game data. |
◆ run()
virtual Common::Error Engine::run |
( |
| ) |
|
|
pure virtual |
Initialize the engine and start its main loop.
- Returns
- kNoError on success, otherwise an error code.
◆ 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.
◆ 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()
Determine whether the engine supports the specified feature.
◆ 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.
◆ 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.
◆ flipMute()
virtual void Engine::flipMute |
( |
| ) |
|
|
virtual |
Flip mute all sound options.
◆ getSaveStateName()
virtual Common::String Engine::getSaveStateName |
( |
int |
slot | ) |
const |
|
inlinevirtual |
Generate the savegame filename.
◆ loadGameState()
virtual Common::Error Engine::loadGameState |
( |
int |
slot | ) |
|
|
virtual |
Load a game state.
- Parameters
-
slot | The slot from which a save state should be loaded. |
- Returns
- kNoError on success, otherwise an error code.
◆ loadGameStream()
virtual Common::Error Engine::loadGameStream |
( |
Common::SeekableReadStream * |
stream | ) |
|
|
virtual |
Load a game state.
- Parameters
-
stream | The stream to load the save state from. |
- Returns
- kNoError on success, otherwise an error code.
◆ 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
-
slot | The slot from which a save state should be loaded. |
◆ canLoadGameStateCurrently()
virtual bool Engine::canLoadGameStateCurrently |
( |
| ) |
|
|
virtual |
Indicate whether a game state can be loaded.
◆ saveGameState()
virtual Common::Error Engine::saveGameState |
( |
int |
slot, |
|
|
const Common::String & |
desc, |
|
|
bool |
isAutosave = false |
|
) |
| |
|
virtual |
Save a game state.
- Parameters
-
slot | The slot into which the save state should be stored. |
desc | Description for the save state, entered by the user. |
isAutosave | Expected to be true if an autosave is being created. |
- Returns
- kNoError on success, otherwise an error code.
◆ saveGameStream()
virtual Common::Error Engine::saveGameStream |
( |
Common::WriteStream * |
stream, |
|
|
bool |
isAutosave = false |
|
) |
| |
|
virtual |
Save a game state.
- Parameters
-
stream | The write stream to save the savegame data to. |
isAutosave | Expected to be true if an autosave is being created. |
- Returns
- kNoError on success, otherwise an error code.
◆ canSaveGameStateCurrently()
virtual bool Engine::canSaveGameStateCurrently |
( |
| ) |
|
|
virtual |
Indicate whether a game state can be saved.
◆ 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()
virtual void Engine::pauseEngineIntern |
( |
bool |
pause | ) |
|
|
protectedvirtual |
◆ 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 respectively should return to the launcher.
◆ getMetaEngineDetection()
◆ getMetaEngine()
Return the MetaEngine instance used by this 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
-
extraMsg | An 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
-
time | Play 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()
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.
◆ 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.
◆ shouldPerformAutoSave()
bool Engine::shouldPerformAutoSave |
( |
int |
lastSaveTime | ) |
|
|
inline |
Check whether it is time to autosave based on the provided lastSaveTime
.
◆ PauseToken
◆ _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 |
The documentation for this class was generated from the following file: