DM::DMEngine Class Reference

#include <dm.h>

+ Inheritance diagram for DM::DMEngine:
+ Collaboration diagram for DM::DMEngine:

Public Member Functions

 DMEngine (OSystem *syst, const DMADGameDescription *gameDesc)
 ~DMEngine () override
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. 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 isDemo () const
void delay (uint16 verticalBlank)
uint16 getScaledProduct (uint16 val, uint16 scale, uint16 vale2)
uint16 getRandomNumber (uint32 max)
int16 ordinalToIndex (int16 val)
int16 indexToOrdinal (int16 val)
Common::Error run () override
 Init the engine and start its main loop. More...
void saveGame ()
LoadgameResult loadgame (int16 slot)
void endGame (bool doNotDrawCreditsOnly)
void entranceDrawCredits ()
void fuseSequence ()
Common::Language getGameLanguage ()
Direction turnDirRight (int16 dir)
Direction turnDirLeft (int16 dir)
Direction returnOppositeDir (int16 dir)
bool isOrientedWestEast (int16 dir)
uint16 normalizeModulo4 (int16 dir)
int32 filterTime (int32 mapTime)
int32 setMapAndTime (uint32 map, uint32 time)
uint16 getMap (int32 mapTime)
Thing thingWithNewCell (Thing thing, int16 cell)
int16 getDistance (int16 mapx1, int16 mapy1, int16 mapx2, int16 mapy2)
int32 setMap (int32 mapTime, uint32 map)
- 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 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 saveGameState (int slot, const Common::String &desc, bool isAutosave=false)
 Save a game state. More...
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 Save a game state. More...
virtual bool canSaveGameStateCurrently ()
 Indicates whether a game state can be saved. 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

bool _engineShouldQuit
int _loadSaveSlotAtRuntime
GameMode _gameMode
bool _restartGameRequest
bool _stopWaitingForPlayerInput
bool _gameTimeTicking
bool _restartGameAllowed
bool _pressingEye
bool _stopPressingEye
bool _pressingMouth
bool _stopPressingMouth
bool _highlightBoxInversionRequested
int16 _projectileDisableMovementTicks
int16 _lastProjectileDisabledMovementDirection
bool _gameWon
int16 _newPartyMapIndex
bool _setMousePointerToObjectInMainLoop
int16 _disabledMovementTicks
int8 _dirIntoStepCountEast [4]
int8 _dirIntoStepCountNorth [4]
int32 _gameTime
char _stringBuildBuffer [128]
int16 _waitForInputMaxVerticalBlankCount
Thing _thingNone
Thing _thingEndOfList
Thing _thingFirstExplosion
Thing _thingExplFireBall
Thing _thingExplSlime
Thing _thingExplLightningBolt
Thing _thingExplHarmNonMaterial
Thing _thingExplOpenDoor
Thing _thingExplPoisonBolt
Thing _thingExplPoisonCloud
Thing _thingExplSmoke
Thing _thingExplFluxcage
Thing _thingExplRebirthStep1
Thing _thingExplRebirthStep2
Thing _thingParty
- Public Attributes inherited from Engine

Private Member Functions

void startGame ()
void processNewPartyMap (uint16 mapIndex)
void initializeGame ()
void initMemoryManager ()
void gameloop ()
void initConstants ()
Common::String getSavefileName (uint16 slot)
void writeSaveGameHeader (Common::OutSaveFile *out, const Common::String &saveName)
bool writeCompleteSaveFile (int16 slot, Common::String &desc, int16 saveAndPlayChoice)
void drawEntrance ()
void fuseSequenceUpdate ()
void processEntrance ()
void openEntranceDoors ()
void drawTittle ()

Private Attributes

uint16 _dungeonId
byte_entranceDoorAnimSteps [10]
const DMADGameDescription_gameVersion
bool _canLoadFromGMM

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 206 of file dm.h.

Constructor & Destructor Documentation

◆ DMEngine()

DM::DMEngine::DMEngine ( OSystem syst,
const DMADGameDescription gameDesc 

Definition at line 123 of file dm.cpp.

◆ ~DMEngine()

DM::DMEngine::~DMEngine ( )

Definition at line 183 of file dm.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool DM::DMEngine::canLoadGameStateCurrently ( )

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 233 of file dm.cpp.

◆ delay()

void DM::DMEngine::delay ( uint16  verticalBlank)

Definition at line 237 of file dm.cpp.

◆ drawEntrance()

void DM::DMEngine::drawEntrance ( )

Definition at line 750 of file dm.cpp.

◆ drawTittle()

void DM::DMEngine::drawTittle ( )

Definition at line 830 of file dm.cpp.

◆ endGame()

void DM::DMEngine::endGame ( bool  doNotDrawCreditsOnly)

Definition at line 574 of file dm.cpp.

◆ entranceDrawCredits()

void DM::DMEngine::entranceDrawCredits ( )

Definition at line 903 of file dm.cpp.

◆ filterTime()

int32 DM::DMEngine::filterTime ( int32  mapTime)

Definition at line 99 of file dm.cpp.

◆ fuseSequence()

void DM::DMEngine::fuseSequence ( )

Definition at line 913 of file dm.cpp.

◆ fuseSequenceUpdate()

void DM::DMEngine::fuseSequenceUpdate ( )

Definition at line 1032 of file dm.cpp.

◆ gameloop()

void DM::DMEngine::gameloop ( )

Definition at line 399 of file dm.cpp.

◆ getDistance()

int16 DM::DMEngine::getDistance ( int16  mapx1,
int16  mapy1,
int16  mapx2,
int16  mapy2 

Definition at line 119 of file dm.cpp.

◆ getGameLanguage()

Common::Language DM::DMEngine::getGameLanguage ( )

Definition at line 1043 of file dm.cpp.

◆ getMap()

uint16 DM::DMEngine::getMap ( int32  mapTime)

Definition at line 107 of file dm.cpp.

◆ getRandomNumber()

uint16 DM::DMEngine::getRandomNumber ( uint32  max)

Definition at line 235 of file dm.h.

◆ getSavefileName()

Common::String DM::DMEngine::getSavefileName ( uint16  slot)

Definition at line 249 of file loadsave.cpp.

◆ getScaledProduct()

uint16 DM::DMEngine::getScaledProduct ( uint16  val,
uint16  scale,
uint16  vale2 

Definition at line 245 of file dm.cpp.

◆ hasFeature()

bool DM::DMEngine::hasFeature ( EngineFeature  f) const

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 211 of file dm.cpp.

◆ indexToOrdinal()

int16 DM::DMEngine::indexToOrdinal ( int16  val)

Definition at line 517 of file dm.cpp.

◆ initConstants()

void DM::DMEngine::initConstants ( )

Definition at line 44 of file dmglobals.cpp.

◆ initializeGame()

void DM::DMEngine::initializeGame ( )

Definition at line 249 of file dm.cpp.

◆ initMemoryManager()

void DM::DMEngine::initMemoryManager ( )

Definition at line 295 of file dm.cpp.

◆ isDemo()

bool DM::DMEngine::isDemo ( ) const

Definition at line 72 of file dm.cpp.

◆ isOrientedWestEast()

bool DM::DMEngine::isOrientedWestEast ( int16  dir)

Definition at line 91 of file dm.cpp.

◆ loadgame()

LoadgameResult DM::DMEngine::loadgame ( int16  slot)

Definition at line 45 of file loadsave.cpp.

◆ loadGameState()

Common::Error DM::DMEngine::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 217 of file dm.cpp.

◆ normalizeModulo4()

uint16 DM::DMEngine::normalizeModulo4 ( int16  dir)

Definition at line 95 of file dm.cpp.

◆ openEntranceDoors()

void DM::DMEngine::openEntranceDoors ( )

Definition at line 797 of file dm.cpp.

◆ ordinalToIndex()

int16 DM::DMEngine::ordinalToIndex ( int16  val)

Definition at line 513 of file dm.cpp.

◆ processEntrance()

void DM::DMEngine::processEntrance ( )

Definition at line 521 of file dm.cpp.

◆ processNewPartyMap()

void DM::DMEngine::processNewPartyMap ( uint16  mapIndex)

Definition at line 348 of file dm.cpp.

◆ returnOppositeDir()

Direction DM::DMEngine::returnOppositeDir ( int16  dir)

Definition at line 81 of file dm.cpp.

◆ run()

Common::Error DM::DMEngine::run ( )

Init the engine and start its main loop.

returns kNoError on success, else an error code.

Implements Engine.

Definition at line 356 of file dm.cpp.

◆ saveGame()

void DM::DMEngine::saveGame ( )

Definition at line 160 of file loadsave.cpp.

◆ setMap()

int32 DM::DMEngine::setMap ( int32  mapTime,
uint32  map 

Definition at line 111 of file dm.cpp.

◆ setMapAndTime()

int32 DM::DMEngine::setMapAndTime ( uint32  map,
uint32  time 

Definition at line 103 of file dm.cpp.

◆ startGame()

void DM::DMEngine::startGame ( )

Definition at line 305 of file dm.cpp.

◆ thingWithNewCell()

Thing DM::DMEngine::thingWithNewCell ( Thing  thing,
int16  cell 

Definition at line 115 of file dm.cpp.

◆ turnDirLeft()

Direction DM::DMEngine::turnDirLeft ( int16  dir)

Definition at line 86 of file dm.cpp.

◆ turnDirRight()

Direction DM::DMEngine::turnDirRight ( int16  dir)

Definition at line 76 of file dm.cpp.

◆ writeCompleteSaveFile()

bool DM::DMEngine::writeCompleteSaveFile ( int16  slot,
Common::String desc,
int16  saveAndPlayChoice 

Definition at line 285 of file loadsave.cpp.

◆ writeSaveGameHeader()

void DM::DMEngine::writeSaveGameHeader ( Common::OutSaveFile out,
const Common::String saveName 

Definition at line 256 of file loadsave.cpp.

Member Data Documentation

◆ _canLoadFromGMM

bool DM::DMEngine::_canLoadFromGMM

Definition at line 269 of file dm.h.

◆ _championMan

ChampionMan* DM::DMEngine::_championMan

Definition at line 276 of file dm.h.

◆ _console

Console* DM::DMEngine::_console

Definition at line 271 of file dm.h.

◆ _dialog

DialogMan* DM::DMEngine::_dialog

Definition at line 284 of file dm.h.

◆ _dirIntoStepCountEast

int8 DM::DMEngine::_dirIntoStepCountEast[4]

Definition at line 310 of file dm.h.

◆ _dirIntoStepCountNorth

int8 DM::DMEngine::_dirIntoStepCountNorth[4]

Definition at line 311 of file dm.h.

◆ _disabledMovementTicks

int16 DM::DMEngine::_disabledMovementTicks

Definition at line 308 of file dm.h.

◆ _displayMan

DisplayMan* DM::DMEngine::_displayMan

Definition at line 272 of file dm.h.

◆ _dungeonId

uint16 DM::DMEngine::_dungeonId

Definition at line 262 of file dm.h.

◆ _dungeonMan

DungeonMan* DM::DMEngine::_dungeonMan

Definition at line 273 of file dm.h.

◆ _engineShouldQuit

bool DM::DMEngine::_engineShouldQuit

Definition at line 289 of file dm.h.

◆ _entranceDoorAnimSteps

byte* DM::DMEngine::_entranceDoorAnimSteps[10]

Definition at line 263 of file dm.h.

◆ _eventMan

EventManager* DM::DMEngine::_eventMan

Definition at line 274 of file dm.h.

◆ _gameMode

GameMode DM::DMEngine::_gameMode

Definition at line 292 of file dm.h.

◆ _gameTime

int32 DM::DMEngine::_gameTime

Definition at line 312 of file dm.h.

◆ _gameTimeTicking

bool DM::DMEngine::_gameTimeTicking

Definition at line 296 of file dm.h.

◆ _gameVersion

const DMADGameDescription* DM::DMEngine::_gameVersion

Definition at line 268 of file dm.h.

◆ _gameWon

bool DM::DMEngine::_gameWon

Definition at line 305 of file dm.h.

◆ _groupMan

GroupMan* DM::DMEngine::_groupMan

Definition at line 281 of file dm.h.

◆ _highlightBoxInversionRequested

bool DM::DMEngine::_highlightBoxInversionRequested

Definition at line 302 of file dm.h.

◆ _interfaceCredits

byte* DM::DMEngine::_interfaceCredits

Definition at line 264 of file dm.h.

◆ _inventoryMan

InventoryMan* DM::DMEngine::_inventoryMan

Definition at line 278 of file dm.h.

◆ _lastProjectileDisabledMovementDirection

int16 DM::DMEngine::_lastProjectileDisabledMovementDirection

Definition at line 304 of file dm.h.

◆ _loadSaveSlotAtRuntime

int DM::DMEngine::_loadSaveSlotAtRuntime

Definition at line 290 of file dm.h.

◆ _menuMan

MenuMan* DM::DMEngine::_menuMan

Definition at line 275 of file dm.h.

◆ _moveSens

MovesensMan* DM::DMEngine::_moveSens

Definition at line 280 of file dm.h.

◆ _newPartyMapIndex

int16 DM::DMEngine::_newPartyMapIndex

Definition at line 306 of file dm.h.

◆ _objectMan

ObjectMan* DM::DMEngine::_objectMan

Definition at line 277 of file dm.h.

◆ _pressingEye

bool DM::DMEngine::_pressingEye

Definition at line 298 of file dm.h.

◆ _pressingMouth

bool DM::DMEngine::_pressingMouth

Definition at line 300 of file dm.h.

◆ _projectileDisableMovementTicks

int16 DM::DMEngine::_projectileDisableMovementTicks

Definition at line 303 of file dm.h.

◆ _projexpl

ProjExpl* DM::DMEngine::_projexpl

Definition at line 283 of file dm.h.

◆ _restartGameAllowed

bool DM::DMEngine::_restartGameAllowed

Definition at line 297 of file dm.h.

◆ _restartGameRequest

bool DM::DMEngine::_restartGameRequest

Definition at line 293 of file dm.h.

◆ _rnd

Common::RandomSource* DM::DMEngine::_rnd

Definition at line 265 of file dm.h.

◆ _savedScreenForOpenEntranceDoors

byte* DM::DMEngine::_savedScreenForOpenEntranceDoors

Definition at line 267 of file dm.h.

◆ _saveThumbnail

Common::MemoryWriteStreamDynamic* DM::DMEngine::_saveThumbnail

Definition at line 287 of file dm.h.

◆ _setMousePointerToObjectInMainLoop

bool DM::DMEngine::_setMousePointerToObjectInMainLoop

Definition at line 307 of file dm.h.

◆ _sound

SoundMan* DM::DMEngine::_sound

Definition at line 285 of file dm.h.

◆ _stopPressingEye

bool DM::DMEngine::_stopPressingEye

Definition at line 299 of file dm.h.

◆ _stopPressingMouth

bool DM::DMEngine::_stopPressingMouth

Definition at line 301 of file dm.h.

◆ _stopWaitingForPlayerInput

bool DM::DMEngine::_stopWaitingForPlayerInput

Definition at line 295 of file dm.h.

◆ _stringBuildBuffer

char DM::DMEngine::_stringBuildBuffer[128]

Definition at line 313 of file dm.h.

◆ _textMan

TextMan* DM::DMEngine::_textMan

Definition at line 279 of file dm.h.

◆ _thingEndOfList

Thing DM::DMEngine::_thingEndOfList

Definition at line 317 of file dm.h.

◆ _thingExplFireBall

Thing DM::DMEngine::_thingExplFireBall

Definition at line 319 of file dm.h.

◆ _thingExplFluxcage

Thing DM::DMEngine::_thingExplFluxcage

Definition at line 327 of file dm.h.

◆ _thingExplHarmNonMaterial

Thing DM::DMEngine::_thingExplHarmNonMaterial

Definition at line 322 of file dm.h.

◆ _thingExplLightningBolt

Thing DM::DMEngine::_thingExplLightningBolt

Definition at line 321 of file dm.h.

◆ _thingExplOpenDoor

Thing DM::DMEngine::_thingExplOpenDoor

Definition at line 323 of file dm.h.

◆ _thingExplPoisonBolt

Thing DM::DMEngine::_thingExplPoisonBolt

Definition at line 324 of file dm.h.

◆ _thingExplPoisonCloud

Thing DM::DMEngine::_thingExplPoisonCloud

Definition at line 325 of file dm.h.

◆ _thingExplRebirthStep1

Thing DM::DMEngine::_thingExplRebirthStep1

Definition at line 328 of file dm.h.

◆ _thingExplRebirthStep2

Thing DM::DMEngine::_thingExplRebirthStep2

Definition at line 329 of file dm.h.

◆ _thingExplSlime

Thing DM::DMEngine::_thingExplSlime

Definition at line 320 of file dm.h.

◆ _thingExplSmoke

Thing DM::DMEngine::_thingExplSmoke

Definition at line 326 of file dm.h.

◆ _thingFirstExplosion

Thing DM::DMEngine::_thingFirstExplosion

Definition at line 318 of file dm.h.

◆ _thingNone

Thing DM::DMEngine::_thingNone

Definition at line 316 of file dm.h.

◆ _thingParty

Thing DM::DMEngine::_thingParty

Definition at line 330 of file dm.h.

◆ _timeline

Timeline* DM::DMEngine::_timeline

Definition at line 282 of file dm.h.

◆ _waitForInputMaxVerticalBlankCount

int16 DM::DMEngine::_waitForInputMaxVerticalBlankCount

Definition at line 314 of file dm.h.

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