ScummVM
Lure::LureEngine Class Reference

#include <lure.h>

+ Inheritance diagram for Lure::LureEngine:
+ Collaboration diagram for Lure::LureEngine:

Public Member Functions

 LureEngine (OSystem *system, const LureGameDescription *gameDesc)
 
 ~LureEngine () override
 
Common::Error init ()
 
Common::Error go ()
 
Common::Error run () override
 Init the engine and start its main loop. More...
 
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. 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 pauseEngineIntern (bool pause) override
 Actual implementation of pauseEngine by subclasses. More...
 
Diskdisk ()
 
Common::RandomSourcernd ()
 
int gameToLoad ()
 
bool loadGame (uint8 slotNumber)
 
bool saveGame (uint8 slotNumber, Common::String &caption)
 
Common::StringdetectSave (int slotNumber)
 
uint8 saveVersion ()
 
uint32 getFeatures () const
 
LureLanguage getLureLanguage () const
 
Common::Language getLanguage () const
 
Common::Platform getPlatform () const
 
bool isEGA () const
 
Common::Error loadGameState (int slot) override
 Load a game state. More...
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 Save a game state. More...
 
bool canLoadGameStateCurrently () override
 Indicates whether a game state can be loaded. More...
 
bool canSaveGameStateCurrently () override
 Indicates whether a game state can be saved. More...
 
- 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)
 

Static Public Member Functions

static LureEnginegetReference ()
 
- 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...
 

Public Attributes

bool _saveLoadAllowed
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Private Member Functions

const char * generateSaveName (int slotNumber)
 

Private Attributes

bool _initialized
 
int _gameToLoad
 
uint8 _saveVersion
 
Disk_disk
 
Resources_resources
 
Screen_screen
 
Mouse_mouse
 
Events_events
 
Menu_menu
 
StringData_strings
 
Room_room
 
FightsManager_fights
 
Common::RandomSource _rnd
 
const LureGameDescription_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...
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
- 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 66 of file lure.h.

Constructor & Destructor Documentation

◆ LureEngine()

Lure::LureEngine::LureEngine ( OSystem system,
const LureGameDescription gameDesc 
)

Definition at line 42 of file lure.cpp.

◆ ~LureEngine()

Lure::LureEngine::~LureEngine ( )
override

Definition at line 102 of file lure.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Lure::LureEngine::canLoadGameStateCurrently ( )
inlineoverridevirtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 128 of file lure.h.

◆ canSaveGameStateCurrently()

bool Lure::LureEngine::canSaveGameStateCurrently ( )
inlineoverridevirtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 131 of file lure.h.

◆ detectSave()

Common::String * Lure::LureEngine::detectSave ( int  slotNumber)

Definition at line 257 of file lure.cpp.

◆ disk()

Disk& Lure::LureEngine::disk ( )
inline

Definition at line 106 of file lure.h.

◆ gameToLoad()

int Lure::LureEngine::gameToLoad ( )
inline

Definition at line 109 of file lure.h.

◆ generateSaveName()

const char * Lure::LureEngine::generateSaveName ( int  slotNumber)
private

Definition at line 181 of file lure.cpp.

◆ getFeatures()

uint32 Lure::LureEngine::getFeatures ( ) const

Definition at line 40 of file detection.cpp.

◆ getLanguage()

Common::Language Lure::LureEngine::getLanguage ( ) const

Definition at line 41 of file detection.cpp.

◆ getLureLanguage()

LureLanguage Lure::LureEngine::getLureLanguage ( ) const

Definition at line 44 of file detection.cpp.

◆ getPlatform()

Common::Platform Lure::LureEngine::getPlatform ( ) const

Definition at line 42 of file detection.cpp.

◆ getReference()

LureEngine & Lure::LureEngine::getReference ( )
static

Definition at line 122 of file lure.cpp.

◆ go()

Common::Error Lure::LureEngine::go ( )

Definition at line 126 of file lure.cpp.

◆ hasFeature()

bool Lure::LureEngine::hasFeature ( EngineFeature  f) const
overridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 276 of file detection.cpp.

◆ init()

Common::Error Lure::LureEngine::init ( void  )

Definition at line 53 of file lure.cpp.

◆ isEGA()

bool Lure::LureEngine::isEGA ( ) const
inline

Definition at line 119 of file lure.h.

◆ loadGame()

bool Lure::LureEngine::loadGame ( uint8  slotNumber)

Definition at line 212 of file lure.cpp.

◆ loadGameState()

Common::Error Lure::LureEngine::loadGameState ( int  slot)
inlineoverridevirtual

Load a game state.

Parameters
slotthe slot from which a savestate should be loaded
Returns
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 121 of file lure.h.

◆ pauseEngineIntern()

void Lure::LureEngine::pauseEngineIntern ( bool  pause)
overridevirtual

Actual implementation of pauseEngine by subclasses.

See there for details.

Reimplemented from Engine.

Definition at line 171 of file lure.cpp.

◆ rnd()

Common::RandomSource& Lure::LureEngine::rnd ( )
inline

Definition at line 108 of file lure.h.

◆ run()

Common::Error Lure::LureEngine::run ( )
inlineoverridevirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 95 of file lure.h.

◆ saveGame()

bool Lure::LureEngine::saveGame ( uint8  slotNumber,
Common::String caption 
)

Definition at line 188 of file lure.cpp.

◆ saveGameState()

Common::Error Lure::LureEngine::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave = false 
)
inlineoverridevirtual

Save a game state.

Parameters
slotthe slot into which the savestate should be stored
desca description for the savestate, entered by the user
isAutosaveExpected to be true if an autosave is being created
Returns
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 124 of file lure.h.

◆ saveVersion()

uint8 Lure::LureEngine::saveVersion ( )
inline

Definition at line 113 of file lure.h.

◆ syncSoundSettings()

void Lure::LureEngine::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 251 of file lure.cpp.

Member Data Documentation

◆ _disk

Disk* Lure::LureEngine::_disk
private

Definition at line 71 of file lure.h.

◆ _events

Events* Lure::LureEngine::_events
private

Definition at line 75 of file lure.h.

◆ _fights

FightsManager* Lure::LureEngine::_fights
private

Definition at line 79 of file lure.h.

◆ _gameDescription

const LureGameDescription* Lure::LureEngine::_gameDescription
private

Definition at line 84 of file lure.h.

◆ _gameToLoad

int Lure::LureEngine::_gameToLoad
private

Definition at line 69 of file lure.h.

◆ _initialized

bool Lure::LureEngine::_initialized
private

Definition at line 68 of file lure.h.

◆ _menu

Menu* Lure::LureEngine::_menu
private

Definition at line 76 of file lure.h.

◆ _mouse

Mouse* Lure::LureEngine::_mouse
private

Definition at line 74 of file lure.h.

◆ _resources

Resources* Lure::LureEngine::_resources
private

Definition at line 72 of file lure.h.

◆ _rnd

Common::RandomSource Lure::LureEngine::_rnd
private

Definition at line 80 of file lure.h.

◆ _room

Room* Lure::LureEngine::_room
private

Definition at line 78 of file lure.h.

◆ _saveLoadAllowed

bool Lure::LureEngine::_saveLoadAllowed

Definition at line 90 of file lure.h.

◆ _saveVersion

uint8 Lure::LureEngine::_saveVersion
private

Definition at line 70 of file lure.h.

◆ _screen

Screen* Lure::LureEngine::_screen
private

Definition at line 73 of file lure.h.

◆ _strings

StringData* Lure::LureEngine::_strings
private

Definition at line 77 of file lure.h.


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