ScummVM
TsAGE::TSageEngine Class Reference

#include <tsage.h>

+ Inheritance diagram for TsAGE::TSageEngine:
+ Collaboration diagram for TsAGE::TSageEngine:

Public Member Functions

 TSageEngine (OSystem *system, const tSageGameDescription *gameDesc)
 
 ~TSageEngine () override
 
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. More...
 
const char * getGameId () const
 
uint32 getGameID () const
 
uint32 getFeatures () const
 
Common::String getPrimaryFilename () const
 
virtual Common::Error init ()
 
Common::Error run () override
 Init the engine and start its main loop. More...
 
bool canLoadGameStateCurrently () override
 Returns true if it is currently okay to restore a game. More...
 
bool canSaveGameStateCurrently () override
 Returns true if it is currently okay to save the game. More...
 
Common::Error loadGameState (int slot) override
 Load the savegame at the specified slot index. More...
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 Save the game to the given slot index, and with the given name. More...
 
void syncSoundSettings () override
 Notify the engine that the sound settings in the config manager may have changed and that it hence should adjust any internal volume etc. More...
 
void initialize ()
 
void deinitialize ()
 
- Public Member Functions inherited from Engine
 Engine (OSystem *syst)
 
virtual ~Engine ()
 
virtual void initializePath (const Common::FSNode &gamePath)
 Init SearchMan according to the game path. More...
 
virtual void errorString (const char *buf_input, char *buf_output, int buf_output_size)
 Prepare an error string, which is printed by the error() function. More...
 
virtual GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
 
void setDebugger (GUI::Debugger *debugger)
 Sets the engine's debugger. More...
 
GUI::DebuggergetOrCreateDebugger ()
 Return the engine's debugger instance, or create one if none is present. More...
 
virtual void flipMute ()
 Flip mute all sound option. More...
 
virtual Common::String getSaveStateName (int slot) const
 Generates the savegame filename. More...
 
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 Load a game state. More...
 
void setGameToLoadSlot (int slot)
 Sets the game slot for a savegame to be loaded after global main menu execution. More...
 
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 Save a game state. More...
 
bool saveGameDialog ()
 Shows the ScummVM save dialog, allowing users to save their game. More...
 
bool loadGameDialog ()
 Shows the ScummVM Restore dialog, allowing users to load a game. More...
 
void pauseEngine (bool pause)
 Pause or resume the engine. More...
 
bool isPaused () const
 Return whether the engine is currently paused or not. More...
 
void openMainMenuDialog ()
 Run the Global Main Menu Dialog. More...
 
uint32 getTotalPlayTime () const
 Get the total play time. More...
 
void setTotalPlayTime (uint32 time=0)
 Set the game time counter to the specified time. More...
 
Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
Common::SaveFileManagergetSaveFileManager ()
 
void checkCD ()
 On some systems, check if the game appears to be run from CD. More...
 
void handleAutoSave ()
 Checks for whether it's time to do an autosave, and if so, does it. More...
 
void saveAutosaveIfEnabled ()
 Does an autosave immediately if autosaves are turned on. More...
 
virtual bool canSaveAutosaveCurrently ()
 Indicates whether an autosave can currently be saved. More...
 
virtual int getAutosaveSlot () const
 Returns the slot that should be used for autosaves. More...
 
bool shouldPerformAutoSave (int lastSaveTime)
 

Public Attributes

MemoryManager _memoryManager
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Private Attributes

const tSageGameDescription_gameDescription
 

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature { kSupportsSubtitleOptions, kSupportsRTL, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime }
 A feature in this context means an ability of the engine which can be either available or not. More...
 
- Static Public Member Functions inherited from Engine
static void quitGame ()
 Request the engine to quit. More...
 
static bool shouldQuit ()
 Return whether the ENGINE should quit respectively should return to the launcher. More...
 
static MetaEnginegetMetaEngine ()
 
static bool warnUserAboutUnsupportedGame ()
 Display a warning to the user that the game is not fully supported. More...
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Detailed Description

Definition at line 62 of file tsage.h.

Constructor & Destructor Documentation

◆ TSageEngine()

TsAGE::TSageEngine::TSageEngine ( OSystem system,
const tSageGameDescription gameDesc 
)

Definition at line 37 of file tsage.cpp.

◆ ~TSageEngine()

TsAGE::TSageEngine::~TSageEngine ( )
override

Definition at line 61 of file tsage.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool TsAGE::TSageEngine::canLoadGameStateCurrently ( )
overridevirtual

Returns true if it is currently okay to restore a game.

Reimplemented from Engine.

Definition at line 150 of file tsage.cpp.

◆ canSaveGameStateCurrently()

bool TsAGE::TSageEngine::canSaveGameStateCurrently ( )
overridevirtual

Returns true if it is currently okay to save the game.

Reimplemented from Engine.

Definition at line 157 of file tsage.cpp.

◆ deinitialize()

void TsAGE::TSageEngine::deinitialize ( )

Definition at line 128 of file tsage.cpp.

◆ getFeatures()

uint32 TsAGE::TSageEngine::getFeatures ( ) const

Definition at line 50 of file detection.cpp.

◆ getGameId()

const char * TsAGE::TSageEngine::getGameId ( ) const

Definition at line 42 of file detection.cpp.

◆ getGameID()

uint32 TsAGE::TSageEngine::getGameID ( ) const

Definition at line 46 of file detection.cpp.

◆ getPrimaryFilename()

Common::String TsAGE::TSageEngine::getPrimaryFilename ( ) const

Definition at line 54 of file detection.cpp.

◆ hasFeature()

bool TsAGE::TSageEngine::hasFeature ( EngineFeature  f) const
overridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 66 of file tsage.cpp.

◆ init()

Common::Error TsAGE::TSageEngine::init ( void  )
virtual

Definition at line 55 of file tsage.cpp.

◆ initialize()

void TsAGE::TSageEngine::initialize ( )

Definition at line 73 of file tsage.cpp.

◆ loadGameState()

Common::Error TsAGE::TSageEngine::loadGameState ( int  slot)
overridevirtual

Load the savegame at the specified slot index.

Reimplemented from Engine.

Definition at line 164 of file tsage.cpp.

◆ run()

Common::Error TsAGE::TSageEngine::run ( )
overridevirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 136 of file tsage.cpp.

◆ saveGameState()

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

Save the game to the given slot index, and with the given name.

Reimplemented from Engine.

Definition at line 171 of file tsage.cpp.

◆ syncSoundSettings()

void TsAGE::TSageEngine::syncSoundSettings ( )
overridevirtual

Notify the engine that the sound settings in the config manager may have changed and that it hence should adjust any internal volume etc.

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.
Todo:
find a better name for this

Reimplemented from Engine.

Definition at line 175 of file tsage.cpp.

Member Data Documentation

◆ _gameDescription

const tSageGameDescription* TsAGE::TSageEngine::_gameDescription
private

Definition at line 64 of file tsage.h.

◆ _memoryManager

MemoryManager TsAGE::TSageEngine::_memoryManager

Definition at line 70 of file tsage.h.


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