HDB::HDBGame Class Reference

#include <hdb.h>

+ Inheritance diagram for HDB::HDBGame:
+ Collaboration diagram for HDB::HDBGame:

Public Member Functions

 HDBGame (OSystem *syst, const ADGameDescription *gameDesc)
 ~HDBGame () override
bool hasFeature (Engine::EngineFeature f) const override
 Determine whether the engine supports the specified feature. More...
void initializePath (const Common::FSNode &gamePath) override
 Init SearchMan according to the game path. More...
Common::Error run () override
 Init the engine and start its main loop. More...
const char * getGameId () const
const char * getGameFile () const
uint32 getGameFlags () const
Common::Platform getPlatform () const
bool isDemo () const
bool isPPC () const
bool isHandango () const
bool init ()
void save (Common::OutSaveFile *out)
void loadSaveFile (Common::InSaveFile *in)
void start ()
bool restartMap ()
bool startMap (const char *name)
void changeMap (const char *name)
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...
bool canLoadGameStateCurrently () override
 Indicates whether a game state can be loaded. More...
bool canSaveGameStateCurrently () override
 Indicates whether a game state can be saved. More...
void saveGame (Common::OutSaveFile *out)
void loadGame (Common::InSaveFile *in)
Common::String genSaveFileName (uint slot, bool lua)
void saveWhenReady (int slot)
void loadWhenReady (int slot)
void setGameState (GameState gs)
GameState getGameState ()
void changeGameState ()
void paint ()
void moveMap (int x, int y)
void startMoveMap (int x, int y)
void setTargetXY (int x, int y)
void useEntity (AIEntity *e)
void setupProgressBar (int maxCount)
void drawProgressBar ()
void makeProgress ()
void checkProgress ()
void stopProgress ()
void drawLoadingScreen ()
int getActionMode ()
void setActionMode (int status)
void togglePause ()
bool getPause ()
void resetTimer ()
uint32 getTime ()
uint32 getTimeSlice ()
uint32 getTimeSliceDelta ()
const Common::StringgetTargetName ()
int getDebug ()
void setDebug (int flag)
bool isVoiceless ()
char * lastMapName ()
char * currentMapName ()
char * getInMapName ()
void setInMapName (const char *name)
void changeLevel (const char *name)
int32 getStarsMonkeystone7 ()
int32 getStarsMonkeystone14 ()
int32 getStarsMonkeystone21 ()
void setStarsMonkeystone7 (int32 value)
void setStarsMonkeystone14 (int32 value)
void setStarsMonkeystone21 (int32 value)
void setCheatingOn ()
bool getCheatingOn ()
- Public Member Functions inherited from Engine
 Engine (OSystem *syst)
virtual ~Engine ()
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 syncSoundSettings ()
 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...
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

const ADGameDescription_gameDescription
int _screenWidth
int _screenHeight
int _screenDrawWidth
int _screenDrawHeight
int _progressY
Save _saveHeader
bool _gameShutdown
Graphics::PixelFormat _format
bool _progressActive
int _progressCurrent
int _progressXOffset
int _progressMax
Common::Array< uint32_frames
bool active
int slot
- Public Attributes inherited from Engine

Private Attributes

uint32 _timePlayed
uint32 _timeSlice
uint32 _prevTimeSlice
uint32 _timeSeconds
uint32 _tiempo
bool _systemInit
GameState _gameState
int _actionMode
bool _pauseFlag
bool _cheating
int _debugFlag
int _dx
int _dy
char _currentMapname [64]
char _lastMapname [64]
char _currentLuaName [64]
char _lastLuaName [64]
char _inMapName [32]
int32 _monkeystone7
int32 _monkeystone14
int32 _monkeystone21
bool _changeLevel
char _changeMapname [64]
struct {
   bool   active
   int   slot
struct {
   bool   active
   int   slot

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
const Common::String _targetName

Detailed Description

Definition at line 138 of file hdb.h.

Constructor & Destructor Documentation

◆ HDBGame()

HDB::HDBGame::HDBGame ( OSystem syst,
const ADGameDescription gameDesc 

Definition at line 46 of file hdb.cpp.

◆ ~HDBGame()

HDB::HDBGame::~HDBGame ( )

Definition at line 117 of file hdb.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool HDB::HDBGame::canLoadGameStateCurrently ( )

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 86 of file saveload.cpp.

◆ canSaveGameStateCurrently()

bool HDB::HDBGame::canSaveGameStateCurrently ( )

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 35 of file saveload.cpp.

◆ changeGameState()

void HDB::HDBGame::changeGameState ( )

Definition at line 198 of file hdb.cpp.

◆ changeLevel()

void HDB::HDBGame::changeLevel ( const char *  name)

Definition at line 295 of file hdb.h.

◆ changeMap()

void HDB::HDBGame::changeMap ( const char *  name)

Definition at line 193 of file hdb.h.

◆ checkProgress()

void HDB::HDBGame::checkProgress ( )

Definition at line 833 of file hdb.cpp.

◆ currentMapName()

char* HDB::HDBGame::currentMapName ( )

Definition at line 291 of file hdb.h.

◆ drawLoadingScreen()

void HDB::HDBGame::drawLoadingScreen ( )

Definition at line 844 of file hdb.cpp.

◆ drawProgressBar()

void HDB::HDBGame::drawProgressBar ( )

Definition at line 823 of file hdb.cpp.

◆ genSaveFileName()

Common::String HDB::HDBGame::genSaveFileName ( uint  slot,
bool  lua 

Definition at line 384 of file saveload.cpp.

◆ getActionMode()

int HDB::HDBGame::getActionMode ( )

Definition at line 243 of file hdb.h.

◆ getCheatingOn()

bool HDB::HDBGame::getCheatingOn ( )

Definition at line 314 of file hdb.h.

◆ getDebug()

int HDB::HDBGame::getDebug ( )

Definition at line 278 of file hdb.h.

◆ getGameFile()

const char * HDB::HDBGame::getGameFile ( ) const

Definition at line 42 of file detection.cpp.

◆ getGameFlags()

uint32 HDB::HDBGame::getGameFlags ( ) const

Definition at line 46 of file detection.cpp.

◆ getGameId()

const char * HDB::HDBGame::getGameId ( ) const

Definition at line 39 of file detection.cpp.

◆ getGameState()

GameState HDB::HDBGame::getGameState ( )

Definition at line 220 of file hdb.h.

◆ getInMapName()

char* HDB::HDBGame::getInMapName ( )

Definition at line 292 of file hdb.h.

◆ getPause()

bool HDB::HDBGame::getPause ( )

Definition at line 254 of file hdb.h.

◆ getPlatform()

Common::Platform HDB::HDBGame::getPlatform ( ) const

Definition at line 40 of file detection.cpp.

◆ getStarsMonkeystone14()

int32 HDB::HDBGame::getStarsMonkeystone14 ( )

Definition at line 304 of file hdb.h.

◆ getStarsMonkeystone21()

int32 HDB::HDBGame::getStarsMonkeystone21 ( )

Definition at line 305 of file hdb.h.

◆ getStarsMonkeystone7()

int32 HDB::HDBGame::getStarsMonkeystone7 ( )

Definition at line 303 of file hdb.h.

◆ getTargetName()

const Common::String* HDB::HDBGame::getTargetName ( )

Definition at line 274 of file hdb.h.

◆ getTime()

uint32 HDB::HDBGame::getTime ( )

Definition at line 262 of file hdb.h.

◆ getTimeSlice()

uint32 HDB::HDBGame::getTimeSlice ( )

Definition at line 266 of file hdb.h.

◆ getTimeSliceDelta()

uint32 HDB::HDBGame::getTimeSliceDelta ( )

Definition at line 270 of file hdb.h.

◆ hasFeature()

bool HDB::HDBGame::hasFeature ( Engine::EngineFeature  f) const

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 202 of file detection.cpp.

◆ init()

bool HDB::HDBGame::init ( void  )

Definition at line 143 of file hdb.cpp.

◆ initializePath()

void HDB::HDBGame::initializePath ( const Common::FSNode gamePath)

Init SearchMan according to the game path.

By default it adds the directory in non-flat mode with a depth of 4 as priority 0 to SearchMan.

gamePathThe base directory of the game data.

Reimplemented from Engine.

Definition at line 193 of file hdb.cpp.

◆ isDemo()

bool HDB::HDBGame::isDemo ( ) const

Definition at line 50 of file detection.cpp.

◆ isHandango()

bool HDB::HDBGame::isHandango ( ) const

Definition at line 58 of file detection.cpp.

◆ isPPC()

bool HDB::HDBGame::isPPC ( ) const

Definition at line 54 of file detection.cpp.

◆ isVoiceless()

bool HDB::HDBGame::isVoiceless ( )

Definition at line 281 of file hdb.h.

◆ lastMapName()

char* HDB::HDBGame::lastMapName ( )

Definition at line 290 of file hdb.h.

◆ loadGame()

void HDB::HDBGame::loadGame ( Common::InSaveFile in)

Definition at line 167 of file saveload.cpp.

◆ loadGameState()

Common::Error HDB::HDBGame::loadGameState ( int  slot)

Load a game state.

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

Reimplemented from Engine.

Definition at line 90 of file saveload.cpp.

◆ loadSaveFile()

void HDB::HDBGame::loadSaveFile ( Common::InSaveFile in)

Definition at line 218 of file saveload.cpp.

◆ loadWhenReady()

void HDB::HDBGame::loadWhenReady ( int  slot)

Definition at line 212 of file hdb.h.

◆ makeProgress()

void HDB::HDBGame::makeProgress ( )

Definition at line 233 of file hdb.h.

◆ moveMap()

void HDB::HDBGame::moveMap ( int  x,
int  y 

Definition at line 552 of file hdb.cpp.

◆ paint()

void HDB::HDBGame::paint ( )

Definition at line 351 of file hdb.cpp.

◆ resetTimer()

void HDB::HDBGame::resetTimer ( )

Definition at line 258 of file hdb.h.

◆ restartMap()

bool HDB::HDBGame::restartMap ( )

Definition at line 239 of file hdb.cpp.

◆ run()

Common::Error HDB::HDBGame::run ( )

Init the engine and start its main loop.

returns kNoError on success, else an error code.

Implements Engine.

Definition at line 900 of file hdb.cpp.

◆ save()

void HDB::HDBGame::save ( Common::OutSaveFile out)

Definition at line 208 of file saveload.cpp.

◆ saveGame()

void HDB::HDBGame::saveGame ( Common::OutSaveFile out)

Definition at line 133 of file saveload.cpp.

◆ saveGameState()

Common::Error HDB::HDBGame::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave = false 

Save a game state.

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 kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 39 of file saveload.cpp.

◆ saveWhenReady()

void HDB::HDBGame::saveWhenReady ( int  slot)

Definition at line 207 of file hdb.h.

◆ setActionMode()

void HDB::HDBGame::setActionMode ( int  status)

Definition at line 246 of file hdb.h.

◆ setCheatingOn()

void HDB::HDBGame::setCheatingOn ( )

Definition at line 311 of file hdb.h.

◆ setDebug()

void HDB::HDBGame::setDebug ( int  flag)

Definition at line 279 of file hdb.h.

◆ setGameState()

void HDB::HDBGame::setGameState ( GameState  gs)

Definition at line 217 of file hdb.h.

◆ setInMapName()

void HDB::HDBGame::setInMapName ( const char *  name)

Definition at line 887 of file hdb.cpp.

◆ setStarsMonkeystone14()

void HDB::HDBGame::setStarsMonkeystone14 ( int32  value)

Definition at line 308 of file hdb.h.

◆ setStarsMonkeystone21()

void HDB::HDBGame::setStarsMonkeystone21 ( int32  value)

Definition at line 309 of file hdb.h.

◆ setStarsMonkeystone7()

void HDB::HDBGame::setStarsMonkeystone7 ( int32  value)

Definition at line 307 of file hdb.h.

◆ setTargetXY()

void HDB::HDBGame::setTargetXY ( int  x,
int  y 

Definition at line 395 of file hdb.cpp.

◆ setupProgressBar()

void HDB::HDBGame::setupProgressBar ( int  maxCount)

Definition at line 817 of file hdb.cpp.

◆ start()

void HDB::HDBGame::start ( )

Definition at line 233 of file hdb.cpp.

◆ startMap()

bool HDB::HDBGame::startMap ( const char *  name)

Definition at line 326 of file hdb.cpp.

◆ startMoveMap()

void HDB::HDBGame::startMoveMap ( int  x,
int  y 

Definition at line 547 of file hdb.cpp.

◆ stopProgress()

void HDB::HDBGame::stopProgress ( )

Definition at line 238 of file hdb.h.

◆ togglePause()

void HDB::HDBGame::togglePause ( )

Definition at line 250 of file hdb.h.

◆ useEntity()

void HDB::HDBGame::useEntity ( AIEntity e)

Definition at line 566 of file hdb.cpp.

Member Data Documentation

◆ _actionMode

int HDB::HDBGame::_actionMode

Definition at line 345 of file hdb.h.

◆ _ai

AI* HDB::HDBGame::_ai

Definition at line 174 of file hdb.h.

◆ _changeLevel

bool HDB::HDBGame::_changeLevel

Definition at line 366 of file hdb.h.

◆ _changeMapname

char HDB::HDBGame::_changeMapname[64]

Definition at line 367 of file hdb.h.

◆ _cheating

bool HDB::HDBGame::_cheating

Definition at line 349 of file hdb.h.

◆ _currentInSaveFile

Common::InSaveFile* HDB::HDBGame::_currentInSaveFile

Definition at line 331 of file hdb.h.

◆ _currentLuaName

char HDB::HDBGame::_currentLuaName[64]

Definition at line 357 of file hdb.h.

◆ _currentMapname

char HDB::HDBGame::_currentMapname[64]

Definition at line 354 of file hdb.h.

◆ _currentOutSaveFile

Common::OutSaveFile* HDB::HDBGame::_currentOutSaveFile

Definition at line 330 of file hdb.h.

◆ _debugFlag

int HDB::HDBGame::_debugFlag

Definition at line 350 of file hdb.h.

◆ _debugLogo

Tile* HDB::HDBGame::_debugLogo

Definition at line 351 of file hdb.h.

◆ _dx

int HDB::HDBGame::_dx

Definition at line 352 of file hdb.h.

◆ _dy

int HDB::HDBGame::_dy

Definition at line 352 of file hdb.h.

◆ _fileMan

FileMan* HDB::HDBGame::_fileMan

Definition at line 170 of file hdb.h.

◆ _format

Graphics::PixelFormat HDB::HDBGame::_format

Definition at line 320 of file hdb.h.

◆ _frames

Common::Array<uint32> HDB::HDBGame::_frames

Definition at line 328 of file hdb.h.

◆ _gameDescription

const ADGameDescription* HDB::HDBGame::_gameDescription

Definition at line 149 of file hdb.h.

◆ _gameShutdown

bool HDB::HDBGame::_gameShutdown

Definition at line 319 of file hdb.h.

◆ _gameState

GameState HDB::HDBGame::_gameState

Definition at line 344 of file hdb.h.

◆ _gfx

Gfx* HDB::HDBGame::_gfx

Definition at line 171 of file hdb.h.

◆ _inMapName

char HDB::HDBGame::_inMapName[32]

Definition at line 360 of file hdb.h.

◆ _input

Input* HDB::HDBGame::_input

Definition at line 175 of file hdb.h.

◆ _lastLuaName

char HDB::HDBGame::_lastLuaName[64]

Definition at line 358 of file hdb.h.

◆ _lastMapname

char HDB::HDBGame::_lastMapname[64]

Definition at line 355 of file hdb.h.

◆ _loadInfo

struct { ... } HDB::HDBGame::_loadInfo

◆ _loadingScreenGfx

Picture* HDB::HDBGame::_loadingScreenGfx

Definition at line 323 of file hdb.h.

◆ _logoGfx

Picture * HDB::HDBGame::_logoGfx

Definition at line 323 of file hdb.h.

◆ _lua

LuaScript* HDB::HDBGame::_lua

Definition at line 172 of file hdb.h.

◆ _map

Map* HDB::HDBGame::_map

Definition at line 173 of file hdb.h.

◆ _menu

Menu* HDB::HDBGame::_menu

Definition at line 176 of file hdb.h.

◆ _monkeystone14

int32 HDB::HDBGame::_monkeystone14

Definition at line 363 of file hdb.h.

◆ _monkeystone21

int32 HDB::HDBGame::_monkeystone21

Definition at line 364 of file hdb.h.

◆ _monkeystone7

int32 HDB::HDBGame::_monkeystone7

Definition at line 362 of file hdb.h.

◆ _pauseFlag

bool HDB::HDBGame::_pauseFlag

Definition at line 348 of file hdb.h.

◆ _prevTimeSlice

uint32 HDB::HDBGame::_prevTimeSlice

Definition at line 336 of file hdb.h.

◆ _progressActive

bool HDB::HDBGame::_progressActive

Definition at line 324 of file hdb.h.

◆ _progressCurrent

int HDB::HDBGame::_progressCurrent

Definition at line 325 of file hdb.h.

◆ _progressGfx

Picture* HDB::HDBGame::_progressGfx

Definition at line 322 of file hdb.h.

◆ _progressMarkGfx

Picture * HDB::HDBGame::_progressMarkGfx

Definition at line 322 of file hdb.h.

◆ _progressMax

int HDB::HDBGame::_progressMax

Definition at line 325 of file hdb.h.

◆ _progressXOffset

int HDB::HDBGame::_progressXOffset

Definition at line 325 of file hdb.h.

◆ _progressY

int HDB::HDBGame::_progressY

Definition at line 164 of file hdb.h.

◆ _rnd

Common::RandomSource* HDB::HDBGame::_rnd

Definition at line 181 of file hdb.h.

◆ _saveHeader

Save HDB::HDBGame::_saveHeader

Definition at line 318 of file hdb.h.

◆ _saveInfo

struct { ... } HDB::HDBGame::_saveInfo

◆ _screenDrawHeight

int HDB::HDBGame::_screenDrawHeight

Definition at line 163 of file hdb.h.

◆ _screenDrawWidth

int HDB::HDBGame::_screenDrawWidth

Definition at line 162 of file hdb.h.

◆ _screenHeight

int HDB::HDBGame::_screenHeight

Definition at line 161 of file hdb.h.

◆ _screenWidth

int HDB::HDBGame::_screenWidth

Definition at line 160 of file hdb.h.

◆ _sound

Sound* HDB::HDBGame::_sound

Definition at line 177 of file hdb.h.

◆ _systemInit

bool HDB::HDBGame::_systemInit

Definition at line 343 of file hdb.h.

◆ _tiempo

uint32 HDB::HDBGame::_tiempo

Definition at line 339 of file hdb.h.

◆ _timePlayed

uint32 HDB::HDBGame::_timePlayed

Definition at line 335 of file hdb.h.

◆ _timeSeconds

uint32 HDB::HDBGame::_timeSeconds

Definition at line 337 of file hdb.h.

◆ _timeSlice

uint32 HDB::HDBGame::_timeSlice

Definition at line 336 of file hdb.h.

◆ _window

Window* HDB::HDBGame::_window

Definition at line 178 of file hdb.h.

◆ active

bool HDB::HDBGame::active

Definition at line 370 of file hdb.h.

◆ slot

int HDB::HDBGame::slot

Definition at line 371 of file hdb.h.

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