Mohawk::MohawkEngine_Riven Class Reference

#include <riven.h>

+ Inheritance diagram for Mohawk::MohawkEngine_Riven:
+ Collaboration diagram for Mohawk::MohawkEngine_Riven:

Public Member Functions

 MohawkEngine_Riven (OSystem *syst, const MohawkGameDescription *gamedesc)
 ~MohawkEngine_Riven () override
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 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...
Common::String getSaveStateName (int slot) const override
 Generates the savegame filename. More...
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. More...
void doFrame ()
void processInput ()
RivenStackconstructStackById (uint16 id)
void changeToCard (uint16 dest)
void changeToStack (uint16 stackId)
RivenCardgetCard () const
RivenStackgetStack () const
void addZipVisitedCard (uint16 cardId, uint16 cardNameId)
bool isZipVisitedCard (const Common::String &hotspotName) const
uint32getStackVar (uint32 index)
Common::Array< uint16getResourceIDList (uint32 type) const
Common::SeekableReadStreamgetExtrasResource (uint32 tag, uint16 id)
void delay (uint32 ms)
void runOptionsDialog ()
void runLoadDialog ()
void runSaveDialog ()
virtual bool canSaveAutosaveCurrently () override
 Indicates whether an autosave can currently be saved. More...
void loadGameStateAndDisplayError (int slot)
void saveGameStateAndDisplayError (int slot, const Common::String &desc)
bool hasGameEnded () const
 Has the game ended, or has the user requested to quit? More...
void setGameEnded ()
 End the game gracefully. More...
void goToMainMenu ()
void resumeFromMainMenu ()
bool isInMainMenu () const
bool isGameStarted () const
void startNewGame ()
- Public Member Functions inherited from Mohawk::MohawkEngine
 MohawkEngine (OSystem *syst, const MohawkGameDescription *gamedesc)
 ~MohawkEngine () override
const char * getGameId () const
uint32 getFeatures () const
const char * getAppName () const
Common::Platform getPlatform () const
uint8 getGameType () const
Common::Language getLanguage () const
Common::String getDatafileLanguageName (const char *prefix) const
virtual Common::SeekableReadStreamgetResource (uint32 tag, uint16 id)
bool hasResource (uint32 tag, uint16 id)
bool hasResource (uint32 tag, const Common::String &resName)
uint32 getResourceOffset (uint32 tag, uint16 id)
uint16 findResourceID (uint32 type, const Common::String &resName)
Common::String getResourceName (uint32 tag, uint16 id)
void pauseGame ()
- 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::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 int getAutosaveSlot () const
 Returns the slot that should be used for autosaves. More...
bool shouldPerformAutoSave (int lastSaveTime)

Static Public Member Functions

static Common::Array< Common::Keymap * > initKeymaps (const char *target)
- 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 _showHotspots
Common::Array< ZipMode_zipModeData
RivenVariableMap _vars
bool _activatedPLST
bool _activatedSLST
- Public Attributes inherited from Mohawk::MohawkEngine
const MohawkGameDescription_gameDescription
- Public Attributes inherited from Engine

Protected Member Functions

Common::Error run () override
 Init the engine and start its main loop. More...
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)

Private Member Functions

const char ** listExpectedDatafiles () const
void loadLanguageDatafile (char prefix, uint16 stackId)
bool checkDatafiles ()
void initVars ()
void pauseEngineIntern (bool) override
 Actual implementation of pauseEngine by subclasses. More...
uint32 sanitizeTransitionMode (uint32 mode)

Private Attributes

InstallerArchive _installerArchive
int _menuSavedCard
int _menuSavedStack
Common::ScopedPtr< Graphics::Surface, Graphics::SurfaceDeleter_menuThumbnail
bool _gameEnded
uint32 _lastSaveTime

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 Attributes inherited from Mohawk::MohawkEngine
Common::Array< Archive * > _mhk
- Protected Attributes inherited from Engine
const Common::String _targetName

Detailed Description

Definition at line 86 of file riven.h.

Constructor & Destructor Documentation

◆ MohawkEngine_Riven()

Mohawk::MohawkEngine_Riven::MohawkEngine_Riven ( OSystem syst,
const MohawkGameDescription gamedesc 

Definition at line 61 of file riven.cpp.

◆ ~MohawkEngine_Riven()

Mohawk::MohawkEngine_Riven::~MohawkEngine_Riven ( )

Definition at line 100 of file riven.cpp.

Member Function Documentation

◆ addZipVisitedCard()

void Mohawk::MohawkEngine_Riven::addZipVisitedCard ( uint16  cardId,
uint16  cardNameId 

Definition at line 754 of file riven.cpp.

◆ canLoadGameStateCurrently()

bool Mohawk::MohawkEngine_Riven::canLoadGameStateCurrently ( )

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 778 of file riven.cpp.

◆ canSaveAutosaveCurrently()

bool Mohawk::MohawkEngine_Riven::canSaveAutosaveCurrently ( )

Indicates whether an autosave can currently be saved.

Reimplemented from Engine.

Definition at line 750 of file riven.cpp.

◆ canSaveGameStateCurrently()

bool Mohawk::MohawkEngine_Riven::canSaveGameStateCurrently ( )

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 790 of file riven.cpp.

◆ changeToCard()

void Mohawk::MohawkEngine_Riven::changeToCard ( uint16  dest)

Definition at line 597 of file riven.cpp.

◆ changeToStack()

void Mohawk::MohawkEngine_Riven::changeToStack ( uint16  stackId)

Definition at line 387 of file riven.cpp.

◆ checkDatafiles()

bool Mohawk::MohawkEngine_Riven::checkDatafiles ( )

Definition at line 487 of file riven.cpp.

◆ constructStackById()

RivenStack * Mohawk::MohawkEngine_Riven::constructStackById ( uint16  id)

Definition at line 549 of file riven.cpp.

◆ delay()

void Mohawk::MohawkEngine_Riven::delay ( uint32  ms)

Definition at line 645 of file riven.cpp.

◆ doFrame()

void Mohawk::MohawkEngine_Riven::doFrame ( )

Definition at line 212 of file riven.cpp.

◆ getCard()

RivenCard* Mohawk::MohawkEngine_Riven::getCard ( ) const

Definition at line 149 of file riven.h.

◆ getExtrasResource()

Common::SeekableReadStream * Mohawk::MohawkEngine_Riven::getExtrasResource ( uint32  tag,
uint16  id 

Definition at line 630 of file riven.cpp.

◆ getResourceIDList()

Common::Array< uint16 > Mohawk::MohawkEngine_Riven::getResourceIDList ( uint32  type) const

Definition at line 634 of file riven.cpp.

◆ getSaveStateName()

Common::String Mohawk::MohawkEngine_Riven::getSaveStateName ( int  slot) const

Generates the savegame filename.

Reimplemented from Engine.

Definition at line 108 of file riven.h.

◆ getStack()

RivenStack* Mohawk::MohawkEngine_Riven::getStack ( ) const

Definition at line 150 of file riven.h.

◆ getStackVar()

uint32 & Mohawk::MohawkEngine_Riven::getStackVar ( uint32  index)

Definition at line 273 of file riven_vars.cpp.

◆ goToMainMenu()

void Mohawk::MohawkEngine_Riven::goToMainMenu ( )

Definition at line 321 of file riven.cpp.

◆ hasFeature()

bool Mohawk::MohawkEngine_Riven::hasFeature ( EngineFeature  f) const

Determine whether the engine supports the specified feature.

Reimplemented from Mohawk::MohawkEngine.

Definition at line 131 of file detection.cpp.

◆ hasGameEnded()

bool Mohawk::MohawkEngine_Riven::hasGameEnded ( ) const

Has the game ended, or has the user requested to quit?

Definition at line 794 of file riven.cpp.

◆ initKeymaps()

Common::KeymapArray Mohawk::MohawkEngine_Riven::initKeymaps ( const char *  target)

Definition at line 837 of file riven.cpp.

◆ initVars()

void Mohawk::MohawkEngine_Riven::initVars ( )

Definition at line 282 of file riven_vars.cpp.

◆ isGameStarted()

bool Mohawk::MohawkEngine_Riven::isGameStarted ( ) const

Definition at line 354 of file riven.cpp.

◆ isInMainMenu()

bool Mohawk::MohawkEngine_Riven::isInMainMenu ( ) const

Definition at line 349 of file riven.cpp.

◆ isZipVisitedCard()

bool Mohawk::MohawkEngine_Riven::isZipVisitedCard ( const Common::String hotspotName) const

Definition at line 765 of file riven.cpp.

◆ listExpectedDatafiles()

const char ** Mohawk::MohawkEngine_Riven::listExpectedDatafiles ( ) const

Definition at line 441 of file riven.cpp.

◆ loadGameState()

Common::Error Mohawk::MohawkEngine_Riven::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 699 of file riven.cpp.

◆ loadGameStateAndDisplayError()

void Mohawk::MohawkEngine_Riven::loadGameStateAndDisplayError ( int  slot)

Definition at line 711 of file riven.cpp.

◆ loadLanguageDatafile()

void Mohawk::MohawkEngine_Riven::loadLanguageDatafile ( char  prefix,
uint16  stackId 

Definition at line 517 of file riven.cpp.

◆ pauseEngineIntern()

void Mohawk::MohawkEngine_Riven::pauseEngineIntern ( bool  pause)

Actual implementation of pauseEngine by subclasses.

See there for details.

Reimplemented from Engine.

Definition at line 358 of file riven.cpp.

◆ processInput()

void Mohawk::MohawkEngine_Riven::processInput ( )

Definition at line 243 of file riven.cpp.

◆ resumeFromMainMenu()

void Mohawk::MohawkEngine_Riven::resumeFromMainMenu ( )

Definition at line 337 of file riven.cpp.

◆ run()

Common::Error Mohawk::MohawkEngine_Riven::run ( )

Init the engine and start its main loop.

returns kNoError on success, else an error code.

Reimplemented from Mohawk::MohawkEngine.

Definition at line 116 of file riven.cpp.

◆ runLoadDialog()

void Mohawk::MohawkEngine_Riven::runLoadDialog ( )

Definition at line 669 of file riven.cpp.

◆ runOptionsDialog()

void Mohawk::MohawkEngine_Riven::runOptionsDialog ( )

Definition at line 802 of file riven.cpp.

◆ runSaveDialog()

void Mohawk::MohawkEngine_Riven::runSaveDialog ( )

Definition at line 681 of file riven.cpp.

◆ sanitizeTransitionMode()

uint32 Mohawk::MohawkEngine_Riven::sanitizeTransitionMode ( uint32  mode)

Definition at line 374 of file riven.cpp.

◆ saveGameState()

Common::Error Mohawk::MohawkEngine_Riven::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 722 of file riven.cpp.

◆ saveGameStateAndDisplayError()

void Mohawk::MohawkEngine_Riven::saveGameStateAndDisplayError ( int  slot,
const Common::String desc 

Definition at line 739 of file riven.cpp.

◆ setGameEnded()

void Mohawk::MohawkEngine_Riven::setGameEnded ( )

End the game gracefully.

Definition at line 798 of file riven.cpp.

◆ startNewGame()

void Mohawk::MohawkEngine_Riven::startNewGame ( )

Definition at line 653 of file riven.cpp.

Member Data Documentation

◆ _activatedPLST

bool Mohawk::MohawkEngine_Riven::_activatedPLST

Definition at line 164 of file riven.h.

◆ _activatedSLST

bool Mohawk::MohawkEngine_Riven::_activatedSLST

Definition at line 165 of file riven.h.

◆ _card

RivenCard* Mohawk::MohawkEngine_Riven::_card

Definition at line 129 of file riven.h.

◆ _extrasFile

MohawkArchive* Mohawk::MohawkEngine_Riven::_extrasFile

Definition at line 119 of file riven.h.

◆ _gameEnded

bool Mohawk::MohawkEngine_Riven::_gameEnded

Definition at line 136 of file riven.h.

◆ _gfx

RivenGraphics* Mohawk::MohawkEngine_Riven::_gfx

Definition at line 96 of file riven.h.

◆ _installerArchive

InstallerArchive Mohawk::MohawkEngine_Riven::_installerArchive

Definition at line 126 of file riven.h.

◆ _inventory

RivenInventory* Mohawk::MohawkEngine_Riven::_inventory

Definition at line 99 of file riven.h.

◆ _lastSaveTime

uint32 Mohawk::MohawkEngine_Riven::_lastSaveTime

Definition at line 137 of file riven.h.

◆ _menuSavedCard

int Mohawk::MohawkEngine_Riven::_menuSavedCard

Definition at line 132 of file riven.h.

◆ _menuSavedStack

int Mohawk::MohawkEngine_Riven::_menuSavedStack

Definition at line 133 of file riven.h.

◆ _menuThumbnail

Common::ScopedPtr<Graphics::Surface, Graphics::SurfaceDeleter> Mohawk::MohawkEngine_Riven::_menuThumbnail

Definition at line 134 of file riven.h.

◆ _optionsDialog

RivenOptionsDialog* Mohawk::MohawkEngine_Riven::_optionsDialog

Definition at line 125 of file riven.h.

◆ _rnd

Common::RandomSource* Mohawk::MohawkEngine_Riven::_rnd

Definition at line 97 of file riven.h.

◆ _saveLoad

RivenSaveLoad* Mohawk::MohawkEngine_Riven::_saveLoad

Definition at line 124 of file riven.h.

◆ _scriptMan

RivenScriptManager* Mohawk::MohawkEngine_Riven::_scriptMan

Definition at line 98 of file riven.h.

◆ _showHotspots

bool Mohawk::MohawkEngine_Riven::_showHotspots

Definition at line 102 of file riven.h.

◆ _sound

RivenSoundManager* Mohawk::MohawkEngine_Riven::_sound

Definition at line 95 of file riven.h.

◆ _stack

RivenStack* Mohawk::MohawkEngine_Riven::_stack

Definition at line 130 of file riven.h.

◆ _vars

RivenVariableMap Mohawk::MohawkEngine_Riven::_vars

Definition at line 158 of file riven.h.

◆ _video

RivenVideoManager* Mohawk::MohawkEngine_Riven::_video

Definition at line 94 of file riven.h.

◆ _zipModeData

Common::Array<ZipMode> Mohawk::MohawkEngine_Riven::_zipModeData

Definition at line 153 of file riven.h.

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