ScummVM
Queen::QueenEngine Class Reference

#include <queen.h>

+ Inheritance diagram for Queen::QueenEngine:
+ Collaboration diagram for Queen::QueenEngine:

Public Types

enum  {
  SAVESTATE_CUR_VER = 1, SAVESTATE_MAX_NUM = 100, SAVESTATE_MAX_SIZE = 30000, SLOT_LISTPREFIX = -2,
  SLOT_AUTOSAVE = -1, SLOT_QUICKSAVE = 0, MIN_TEXT_SPEED = 4, MAX_TEXT_SPEED = 100
}
 
- 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...
 

Public Member Functions

 QueenEngine (OSystem *syst)
 
 ~QueenEngine () override
 
BamScenebam () const
 
BankManagerbankMan () const
 
Commandcommand () const
 
Debuggerdebugger () const
 
Displaydisplay () const
 
Graphicsgraphics () const
 
Gridgrid () const
 
Inputinput () const
 
Logiclogic () const
 
Resourceresource () const
 
Soundsound () const
 
Walkwalk () const
 
void registerDefaultSettings ()
 
void checkOptionSettings ()
 
void readOptionSettings ()
 
void writeOptionSettings ()
 
int talkSpeed () const
 
void talkSpeed (int speed)
 
bool subtitles () const
 
void subtitles (bool enable)
 
void update (bool checkPlayerInput=false)
 
bool canLoadOrSave () const
 
bool canLoadGameStateCurrently () override
 Indicates whether a game state can be loaded. More...
 
bool canSaveGameStateCurrently () override
 Indicates whether a game state can be saved. More...
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 Save a game state. More...
 
Common::Error loadGameState (int slot) override
 Load a game state. More...
 
virtual int getAutosaveSlot () const
 Returns the slot that should be used for autosaves. More...
 
virtual Common::String getSaveStateName (int slot) const override
 Generates the savegame filename. More...
 
void makeGameStateName (int slot, char *buf) const
 
int getGameStateSlot (const char *filename) const
 
void findGameStateDescriptions (char descriptions[100][32])
 
Common::SeekableReadStreamreadGameStateHeader (int slot, GameStateHeader *gsh)
 
- 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...
 
bool shouldPerformAutoSave (int lastSaveTime)
 

Public Attributes

Common::RandomSource randomizer
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

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...
 
- 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

int _talkSpeed
 
bool _subtitles
 
uint32 _lastUpdateTime
 
bool _gameStarted
 
BamScene_bam
 
BankManager_bankMan
 
Command_command
 
Debugger_debugger
 
Display_display
 
Graphics_graphics
 
Grid_grid
 
Input_input
 
Logic_logic
 
Resource_resource
 
Sound_sound
 
Walk_walk
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Additional Inherited Members

- 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...
 

Detailed Description

Definition at line 63 of file queen.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SAVESTATE_CUR_VER 
SAVESTATE_MAX_NUM 
SAVESTATE_MAX_SIZE 
SLOT_LISTPREFIX 
SLOT_AUTOSAVE 
SLOT_QUICKSAVE 
MIN_TEXT_SPEED 
MAX_TEXT_SPEED 

Definition at line 108 of file queen.h.

Constructor & Destructor Documentation

◆ QueenEngine()

Queen::QueenEngine::QueenEngine ( OSystem syst)

Definition at line 52 of file queen.cpp.

◆ ~QueenEngine()

Queen::QueenEngine::~QueenEngine ( )
override

Definition at line 59 of file queen.cpp.

Member Function Documentation

◆ bam()

BamScene* Queen::QueenEngine::bam ( ) const
inline

Definition at line 69 of file queen.h.

◆ bankMan()

BankManager* Queen::QueenEngine::bankMan ( ) const
inline

Definition at line 70 of file queen.h.

◆ canLoadGameStateCurrently()

bool Queen::QueenEngine::canLoadGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 173 of file queen.cpp.

◆ canLoadOrSave()

bool Queen::QueenEngine::canLoadOrSave ( ) const

Definition at line 169 of file queen.cpp.

◆ canSaveGameStateCurrently()

bool Queen::QueenEngine::canSaveGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 177 of file queen.cpp.

◆ checkOptionSettings()

void Queen::QueenEngine::checkOptionSettings ( )

Definition at line 80 of file queen.cpp.

◆ command()

Command* Queen::QueenEngine::command ( ) const
inline

Definition at line 71 of file queen.h.

◆ debugger()

Debugger* Queen::QueenEngine::debugger ( ) const
inline

Definition at line 72 of file queen.h.

◆ display()

Display* Queen::QueenEngine::display ( ) const
inline

Definition at line 73 of file queen.h.

◆ findGameStateDescriptions()

void Queen::QueenEngine::findGameStateDescriptions ( char  descriptions[100][32])

Definition at line 298 of file queen.cpp.

◆ getAutosaveSlot()

virtual int Queen::QueenEngine::getAutosaveSlot ( ) const
inlinevirtual

Returns the slot that should be used for autosaves.

Note
This should match the meta engine getAutosaveSlot() method

Reimplemented from Engine.

Definition at line 101 of file queen.h.

◆ getGameStateSlot()

int Queen::QueenEngine::getGameStateSlot ( const char *  filename) const

Definition at line 289 of file queen.cpp.

◆ getSaveStateName()

Common::String Queen::QueenEngine::getSaveStateName ( int  slot) const
overridevirtual

Generates the savegame filename.

Reimplemented from Engine.

Definition at line 273 of file queen.cpp.

◆ graphics()

Graphics* Queen::QueenEngine::graphics ( ) const
inline

Definition at line 74 of file queen.h.

◆ grid()

Grid* Queen::QueenEngine::grid ( ) const
inline

Definition at line 75 of file queen.h.

◆ hasFeature()

bool Queen::QueenEngine::hasFeature ( EngineFeature  f) const
overrideprotectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 313 of file queen.cpp.

◆ input()

Input* Queen::QueenEngine::input ( ) const
inline

Definition at line 76 of file queen.h.

◆ loadGameState()

Common::Error Queen::QueenEngine::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 226 of file queen.cpp.

◆ logic()

Logic* Queen::QueenEngine::logic ( ) const
inline

Definition at line 77 of file queen.h.

◆ makeGameStateName()

void Queen::QueenEngine::makeGameStateName ( int  slot,
char *  buf 
) const

Definition at line 284 of file queen.cpp.

◆ readGameStateHeader()

Common::InSaveFile * Queen::QueenEngine::readGameStateHeader ( int  slot,
GameStateHeader gsh 
)

Definition at line 258 of file queen.cpp.

◆ readOptionSettings()

void Queen::QueenEngine::readOptionSettings ( )

Definition at line 105 of file queen.cpp.

◆ registerDefaultSettings()

void Queen::QueenEngine::registerDefaultSettings ( )

Definition at line 74 of file queen.cpp.

◆ resource()

Resource* Queen::QueenEngine::resource ( ) const
inline

Definition at line 78 of file queen.h.

◆ run()

Common::Error Queen::QueenEngine::run ( )
overrideprotectedvirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 321 of file queen.cpp.

◆ saveGameState()

Common::Error Queen::QueenEngine::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 181 of file queen.cpp.

◆ sound()

Sound* Queen::QueenEngine::sound ( ) const
inline

Definition at line 79 of file queen.h.

◆ subtitles() [1/2]

bool Queen::QueenEngine::subtitles ( ) const
inline

Definition at line 91 of file queen.h.

◆ subtitles() [2/2]

void Queen::QueenEngine::subtitles ( bool  enable)
inline

Definition at line 92 of file queen.h.

◆ syncSoundSettings()

void Queen::QueenEngine::syncSoundSettings ( )
overrideprotectedvirtual

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 99 of file queen.cpp.

◆ talkSpeed() [1/2]

int Queen::QueenEngine::talkSpeed ( ) const
inline

Definition at line 89 of file queen.h.

◆ talkSpeed() [2/2]

void Queen::QueenEngine::talkSpeed ( int  speed)
inline

Definition at line 90 of file queen.h.

◆ update()

void Queen::QueenEngine::update ( bool  checkPlayerInput = false)

Definition at line 129 of file queen.cpp.

◆ walk()

Walk* Queen::QueenEngine::walk ( ) const
inline

Definition at line 80 of file queen.h.

◆ writeOptionSettings()

void Queen::QueenEngine::writeOptionSettings ( )

Definition at line 119 of file queen.cpp.

Member Data Documentation

◆ _bam

BamScene* Queen::QueenEngine::_bam
protected

Definition at line 134 of file queen.h.

◆ _bankMan

BankManager* Queen::QueenEngine::_bankMan
protected

Definition at line 135 of file queen.h.

◆ _command

Command* Queen::QueenEngine::_command
protected

Definition at line 136 of file queen.h.

◆ _debugger

Debugger* Queen::QueenEngine::_debugger
protected

Definition at line 137 of file queen.h.

◆ _display

Display* Queen::QueenEngine::_display
protected

Definition at line 138 of file queen.h.

◆ _gameStarted

bool Queen::QueenEngine::_gameStarted
protected

Definition at line 132 of file queen.h.

◆ _graphics

Graphics* Queen::QueenEngine::_graphics
protected

Definition at line 139 of file queen.h.

◆ _grid

Grid* Queen::QueenEngine::_grid
protected

Definition at line 140 of file queen.h.

◆ _input

Input* Queen::QueenEngine::_input
protected

Definition at line 141 of file queen.h.

◆ _lastUpdateTime

uint32 Queen::QueenEngine::_lastUpdateTime
protected

Definition at line 131 of file queen.h.

◆ _logic

Logic* Queen::QueenEngine::_logic
protected

Definition at line 142 of file queen.h.

◆ _resource

Resource* Queen::QueenEngine::_resource
protected

Definition at line 143 of file queen.h.

◆ _sound

Sound* Queen::QueenEngine::_sound
protected

Definition at line 144 of file queen.h.

◆ _subtitles

bool Queen::QueenEngine::_subtitles
protected

Definition at line 130 of file queen.h.

◆ _talkSpeed

int Queen::QueenEngine::_talkSpeed
protected

Definition at line 129 of file queen.h.

◆ _walk

Walk* Queen::QueenEngine::_walk
protected

Definition at line 145 of file queen.h.

◆ randomizer

Common::RandomSource Queen::QueenEngine::randomizer

Definition at line 82 of file queen.h.


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