Neverhood::NeverhoodEngine Class Reference

#include <neverhood.h>

+ Inheritance diagram for Neverhood::NeverhoodEngine:
+ Collaboration diagram for Neverhood::NeverhoodEngine:


struct  SaveHeader

Public Types

enum  kReadSaveHeaderError { kRSHENoError = 0, kRSHEInvalidType = 1, kRSHEInvalidVersion = 2, kRSHEIoError = 3 }
- 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

 NeverhoodEngine (OSystem *syst, const NeverhoodGameDescription *gameDesc)
 ~NeverhoodEngine () override
const char * getGameId () const
uint32 getFeatures () const
uint16 getVersion () const
Common::Platform getPlatform () const
Common::Language getLanguage () const
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. More...
bool isDemo () const
bool applyResourceFixes () const
Common::String getTargetName ()
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 &description, bool isAutosave=false) override
 Save a game state. More...
Common::Error removeGameState (int slot)
bool savegame (const char *filename, const char *description)
bool loadgame (const char *filename)
Common::String getSaveStateName (int slot) const override
 Generates the savegame filename. More...
GameStategameState ()
GameModulegameModule ()
int16 getMouseX () const
int16 getMouseY () const
NPoint getMousePos ()
void toggleSoundUpdate (bool state)
void toggleMusic (bool state)
bool musicIsEnabled ()
- 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 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 getSavegameFilename (const Common::String &target, int num)
static WARN_UNUSED_RESULT kReadSaveHeaderError readSaveHeader (Common::SeekableReadStream *in, SaveHeader &header, bool skipThumbnail=true)
- 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

const NeverhoodGameDescription_gameDescription
int16 _mouseX
int16 _mouseY
uint16 _buttonState
GameState _gameState
bool _isSaveAllowed
- Public Attributes inherited from Engine

Protected Member Functions

Common::Error run () override
 Init the engine and start its main loop. More...
void mainLoop ()
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...

Private Attributes

bool _updateSound
bool _enableMusic

Additional Inherited Members

- Protected Attributes inherited from Engine
const Common::String _targetName

Detailed Description

Definition at line 59 of file neverhood.h.

Member Enumeration Documentation

◆ kReadSaveHeaderError


Definition at line 100 of file neverhood.h.

Constructor & Destructor Documentation

◆ NeverhoodEngine()

Neverhood::NeverhoodEngine::NeverhoodEngine ( OSystem syst,
const NeverhoodGameDescription gameDesc 

Definition at line 50 of file neverhood.cpp.

◆ ~NeverhoodEngine()

Neverhood::NeverhoodEngine::~NeverhoodEngine ( )

Definition at line 64 of file neverhood.cpp.

Member Function Documentation

◆ applyResourceFixes()

bool Neverhood::NeverhoodEngine::applyResourceFixes ( ) const

Definition at line 67 of file detection.cpp.

◆ canLoadGameStateCurrently()

bool Neverhood::NeverhoodEngine::canLoadGameStateCurrently ( )

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 120 of file neverhood.h.

◆ canSaveGameStateCurrently()

bool Neverhood::NeverhoodEngine::canSaveGameStateCurrently ( )

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 121 of file neverhood.h.

◆ gameModule()

GameModule* Neverhood::NeverhoodEngine::gameModule ( )

Definition at line 133 of file neverhood.h.

◆ gameState()

GameState& Neverhood::NeverhoodEngine::gameState ( )

Definition at line 132 of file neverhood.h.

◆ getFeatures()

uint32 Neverhood::NeverhoodEngine::getFeatures ( ) const

Definition at line 47 of file detection.cpp.

◆ getGameId()

const char * Neverhood::NeverhoodEngine::getGameId ( ) const

Definition at line 43 of file detection.cpp.

◆ getLanguage()

Common::Language Neverhood::NeverhoodEngine::getLanguage ( ) const

Definition at line 55 of file detection.cpp.

◆ getMousePos()

NPoint Neverhood::NeverhoodEngine::getMousePos ( )

Definition at line 201 of file neverhood.cpp.

◆ getMouseX()

int16 Neverhood::NeverhoodEngine::getMouseX ( ) const

Definition at line 134 of file neverhood.h.

◆ getMouseY()

int16 Neverhood::NeverhoodEngine::getMouseY ( ) const

Definition at line 135 of file neverhood.h.

◆ getPlatform()

Common::Platform Neverhood::NeverhoodEngine::getPlatform ( ) const

Definition at line 51 of file detection.cpp.

◆ getSavegameFilename()

Common::String Neverhood::NeverhoodEngine::getSavegameFilename ( const Common::String target,
int  num 

Definition at line 157 of file saveload.cpp.

◆ getSaveStateName()

Common::String Neverhood::NeverhoodEngine::getSaveStateName ( int  slot) const

Generates the savegame filename.

Reimplemented from Engine.

Definition at line 153 of file saveload.cpp.

◆ getTargetName()

Common::String Neverhood::NeverhoodEngine::getTargetName ( )

Definition at line 79 of file neverhood.h.

◆ getVersion()

uint16 Neverhood::NeverhoodEngine::getVersion ( ) const

Definition at line 59 of file detection.cpp.

◆ hasFeature()

bool Neverhood::NeverhoodEngine::hasFeature ( EngineFeature  f) const

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 238 of file detection.cpp.

◆ isDemo()

bool Neverhood::NeverhoodEngine::isDemo ( ) const

Definition at line 63 of file detection.cpp.

◆ loadgame()

bool Neverhood::NeverhoodEngine::loadgame ( const char *  filename)

Definition at line 102 of file saveload.cpp.

◆ loadGameState()

Common::Error Neverhood::NeverhoodEngine::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 132 of file saveload.cpp.

◆ mainLoop()

void Neverhood::NeverhoodEngine::mainLoop ( )

Definition at line 148 of file neverhood.cpp.

◆ musicIsEnabled()

bool Neverhood::NeverhoodEngine::musicIsEnabled ( )

Definition at line 140 of file neverhood.h.

◆ readSaveHeader()

WARN_UNUSED_RESULT NeverhoodEngine::kReadSaveHeaderError Neverhood::NeverhoodEngine::readSaveHeader ( Common::SeekableReadStream in,
SaveHeader header,
bool  skipThumbnail = true 

Definition at line 35 of file saveload.cpp.

◆ removeGameState()

Common::Error Neverhood::NeverhoodEngine::removeGameState ( int  slot)

Definition at line 146 of file saveload.cpp.

◆ run()

Common::Error Neverhood::NeverhoodEngine::run ( )

Init the engine and start its main loop.

returns kNoError on success, else an error code.

Implements Engine.

Definition at line 68 of file neverhood.cpp.

◆ savegame()

bool Neverhood::NeverhoodEngine::savegame ( const char *  filename,
const char *  description 

Definition at line 61 of file saveload.cpp.

◆ saveGameState()

Common::Error Neverhood::NeverhoodEngine::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 139 of file saveload.cpp.

◆ toggleMusic()

void Neverhood::NeverhoodEngine::toggleMusic ( bool  state)

Definition at line 139 of file neverhood.h.

◆ toggleSoundUpdate()

void Neverhood::NeverhoodEngine::toggleSoundUpdate ( bool  state)

Definition at line 138 of file neverhood.h.

Member Data Documentation

◆ _audioResourceMan

AudioResourceMan* Neverhood::NeverhoodEngine::_audioResourceMan

Definition at line 94 of file neverhood.h.

◆ _buttonState

uint16 Neverhood::NeverhoodEngine::_buttonState

Definition at line 84 of file neverhood.h.

◆ _enableMusic

bool Neverhood::NeverhoodEngine::_enableMusic

Definition at line 144 of file neverhood.h.

◆ _gameDescription

const NeverhoodGameDescription* Neverhood::NeverhoodEngine::_gameDescription

Definition at line 70 of file neverhood.h.

◆ _gameModule

GameModule* Neverhood::NeverhoodEngine::_gameModule

Definition at line 90 of file neverhood.h.

◆ _gameState

GameState Neverhood::NeverhoodEngine::_gameState

Definition at line 86 of file neverhood.h.

◆ _gameVars

GameVars* Neverhood::NeverhoodEngine::_gameVars

Definition at line 87 of file neverhood.h.

◆ _isSaveAllowed

bool Neverhood::NeverhoodEngine::_isSaveAllowed

Definition at line 118 of file neverhood.h.

◆ _mouseX

int16 Neverhood::NeverhoodEngine::_mouseX

Definition at line 83 of file neverhood.h.

◆ _mouseY

int16 Neverhood::NeverhoodEngine::_mouseY

Definition at line 83 of file neverhood.h.

◆ _res

ResourceMan* Neverhood::NeverhoodEngine::_res

Definition at line 89 of file neverhood.h.

◆ _rnd

Common::RandomSource* Neverhood::NeverhoodEngine::_rnd

Definition at line 79 of file neverhood.h.

◆ _screen

Screen* Neverhood::NeverhoodEngine::_screen

Definition at line 88 of file neverhood.h.

◆ _soundMan

SoundMan* Neverhood::NeverhoodEngine::_soundMan

Definition at line 93 of file neverhood.h.

◆ _staticData

StaticData* Neverhood::NeverhoodEngine::_staticData

Definition at line 91 of file neverhood.h.

◆ _updateSound

bool Neverhood::NeverhoodEngine::_updateSound

Definition at line 143 of file neverhood.h.

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