ScummVM
Draci::DraciEngine Class Reference

#include <draci.h>

+ Inheritance diagram for Draci::DraciEngine:
+ Collaboration diagram for Draci::DraciEngine:

Public Member Functions

 DraciEngine (OSystem *syst, const ADGameDescription *gameDesc)
 
 ~DraciEngine () override
 
int init ()
 
Common::Error run () override
 Init the engine and start its main loop. More...
 
bool hasFeature (Engine::EngineFeature f) const override
 Determine whether the engine supports the specified feature. More...
 
void pauseEngineIntern (bool pause) override
 Actual implementation of pauseEngine by subclasses. 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 handleEvents ()
 
Common::String getSaveStateName (int slot) const override
 Generates the savegame filename. More...
 
Common::Error loadGameState (int slot) override
 Load a game state. More...
 
bool canLoadGameStateCurrently () override
 Indicates whether a game state can be loaded. More...
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 Save a game state. 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::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 Common::String getSavegameFile (int saveGameIdx)
 
- 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

Screen_screen
 
Mouse_mouse
 
Game_game
 
Script_script
 
AnimationManager_anims
 
Sound_sound
 
MusicPlayer_music
 
Font_smallFont
 
Font_bigFont
 
BArchive_iconsArchive
 
BArchive_objectsArchive
 
BArchive_spritesArchive
 
BArchive_paletteArchive
 
BArchive_roomsArchive
 
BArchive_overlaysArchive
 
BArchive_animationsArchive
 
BArchive_walkingMapsArchive
 
BArchive_itemsArchive
 
BArchive_itemImagesArchive
 
BArchive_initArchive
 
BArchive_stringsArchive
 
SoundArchive_soundsArchive
 
SoundArchive_dubbingArchive
 
bool _showWalkingMap
 
Common::RandomSource _rnd
 
int32 _pauseStartTime
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

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 56 of file draci.h.

Constructor & Destructor Documentation

◆ DraciEngine()

Draci::DraciEngine::DraciEngine ( OSystem syst,
const ADGameDescription gameDesc 
)

Definition at line 72 of file draci.cpp.

◆ ~DraciEngine()

Draci::DraciEngine::~DraciEngine ( )
override

Definition at line 367 of file draci.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Draci::DraciEngine::canLoadGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 466 of file draci.cpp.

◆ canSaveGameStateCurrently()

bool Draci::DraciEngine::canSaveGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 475 of file draci.cpp.

◆ getSavegameFile()

Common::String Draci::DraciEngine::getSavegameFile ( int  saveGameIdx)
static

Definition at line 449 of file draci.cpp.

◆ getSaveStateName()

Common::String Draci::DraciEngine::getSaveStateName ( int  slot) const
inlineoverridevirtual

Generates the savegame filename.

Reimplemented from Engine.

Definition at line 71 of file draci.h.

◆ handleEvents()

void Draci::DraciEngine::handleEvents ( )

Definition at line 261 of file draci.cpp.

◆ hasFeature()

bool Draci::DraciEngine::hasFeature ( Engine::EngineFeature  f) const
overridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 111 of file draci.cpp.

◆ init()

int Draci::DraciEngine::init ( void  )

Definition at line 151 of file draci.cpp.

◆ loadGameState()

Common::Error Draci::DraciEngine::loadGameState ( int  slot)
overridevirtual

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 453 of file draci.cpp.

◆ pauseEngineIntern()

void Draci::DraciEngine::pauseEngineIntern ( bool  pause)
overridevirtual

Actual implementation of pauseEngine by subclasses.

See there for details.

Reimplemented from Engine.

Definition at line 420 of file draci.cpp.

◆ run()

Common::Error Draci::DraciEngine::run ( )
overridevirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 406 of file draci.cpp.

◆ saveGameState()

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

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 471 of file draci.cpp.

◆ syncSoundSettings()

void Draci::DraciEngine::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 442 of file draci.cpp.

Member Data Documentation

◆ _animationsArchive

BArchive* Draci::DraciEngine::_animationsArchive

Definition at line 94 of file draci.h.

◆ _anims

AnimationManager* Draci::DraciEngine::_anims

Definition at line 81 of file draci.h.

◆ _bigFont

Font* Draci::DraciEngine::_bigFont

Definition at line 86 of file draci.h.

◆ _dubbingArchive

SoundArchive* Draci::DraciEngine::_dubbingArchive

Definition at line 102 of file draci.h.

◆ _game

Game* Draci::DraciEngine::_game

Definition at line 79 of file draci.h.

◆ _iconsArchive

BArchive* Draci::DraciEngine::_iconsArchive

Definition at line 88 of file draci.h.

◆ _initArchive

BArchive* Draci::DraciEngine::_initArchive

Definition at line 98 of file draci.h.

◆ _itemImagesArchive

BArchive* Draci::DraciEngine::_itemImagesArchive

Definition at line 97 of file draci.h.

◆ _itemsArchive

BArchive* Draci::DraciEngine::_itemsArchive

Definition at line 96 of file draci.h.

◆ _mouse

Mouse* Draci::DraciEngine::_mouse

Definition at line 78 of file draci.h.

◆ _music

MusicPlayer* Draci::DraciEngine::_music

Definition at line 83 of file draci.h.

◆ _objectsArchive

BArchive* Draci::DraciEngine::_objectsArchive

Definition at line 89 of file draci.h.

◆ _overlaysArchive

BArchive* Draci::DraciEngine::_overlaysArchive

Definition at line 93 of file draci.h.

◆ _paletteArchive

BArchive* Draci::DraciEngine::_paletteArchive

Definition at line 91 of file draci.h.

◆ _pauseStartTime

int32 Draci::DraciEngine::_pauseStartTime

Definition at line 108 of file draci.h.

◆ _rnd

Common::RandomSource Draci::DraciEngine::_rnd

Definition at line 106 of file draci.h.

◆ _roomsArchive

BArchive* Draci::DraciEngine::_roomsArchive

Definition at line 92 of file draci.h.

◆ _screen

Screen* Draci::DraciEngine::_screen

Definition at line 77 of file draci.h.

◆ _script

Script* Draci::DraciEngine::_script

Definition at line 80 of file draci.h.

◆ _showWalkingMap

bool Draci::DraciEngine::_showWalkingMap

Definition at line 104 of file draci.h.

◆ _smallFont

Font* Draci::DraciEngine::_smallFont

Definition at line 85 of file draci.h.

◆ _sound

Sound* Draci::DraciEngine::_sound

Definition at line 82 of file draci.h.

◆ _soundsArchive

SoundArchive* Draci::DraciEngine::_soundsArchive

Definition at line 101 of file draci.h.

◆ _spritesArchive

BArchive* Draci::DraciEngine::_spritesArchive

Definition at line 90 of file draci.h.

◆ _stringsArchive

BArchive* Draci::DraciEngine::_stringsArchive

Definition at line 99 of file draci.h.

◆ _walkingMapsArchive

BArchive* Draci::DraciEngine::_walkingMapsArchive

Definition at line 95 of file draci.h.


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