ScummVM
Neverhood::NeverhoodEngine Class Reference

#include <neverhood.h>

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

Classes

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,
  kSupportsJoystick
}
 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)
 
virtual ~NeverhoodEngine ()
 
const char * getGameId () const
 
uint32 getFeatures () const
 
uint16 getVersion () const
 
Common::Platform getPlatform () const
 
Common::Language getLanguage () const
 
bool hasFeature (EngineFeature f) const
 Determine whether the engine supports the specified feature. More...
 
bool isDemo () const
 
bool applyResourceFixes () const
 
Common::String getTargetName ()
 
GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
 
bool canLoadGameStateCurrently ()
 Indicates whether a game state can be loaded. More...
 
bool canSaveGameStateCurrently ()
 Indicates whether a game state can be saved. More...
 
Common::Error loadGameState (int slot)
 Load a game state. More...
 
Common::Error saveGameState (int slot, const Common::String &description)
 Save a game state. More...
 
Common::Error removeGameState (int slot)
 
bool savegame (const char *filename, const char *description)
 
bool loadgame (const char *filename)
 
const char * getSavegameFilename (int num)
 
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
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...
 
 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 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 initKeymap ()
 
virtual void deinitKeymap ()
 
virtual void flipMute ()
 Flip mute all sound option. More...
 
void setGameToLoadSlot (int slot)
 Sets the game slot for a savegame to be loaded after global main menu execution. More...
 

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 bool warnUserAboutUnsupportedGame ()
 Display a warning to the user that the game is not fully supported. More...
 

Public Attributes

const NeverhoodGameDescription_gameDescription
 
Common::RandomSource_rnd
 
int16 _mouseX
 
int16 _mouseY
 
uint16 _buttonState
 
GameState _gameState
 
GameVars_gameVars
 
Screen_screen
 
ResourceMan_res
 
GameModule_gameModule
 
StaticData_staticData
 
Console_console
 
SoundMan_soundMan
 
AudioResourceMan_audioResourceMan
 
bool _isSaveAllowed
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

Common::Error run ()
 Init the engine and start its main loop. More...
 
void mainLoop ()
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
bool shouldPerformAutoSave (int lastSaveTime)
 Indicate whether an autosave should be performed. More...
 
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
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Detailed Description

Definition at line 59 of file neverhood.h.

Member Enumeration Documentation

◆ kReadSaveHeaderError

Enumerator
kRSHENoError 
kRSHEInvalidType 
kRSHEInvalidVersion 
kRSHEIoError 

Definition at line 102 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 ( )
virtual

Definition at line 63 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 ( )
inlinevirtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 122 of file neverhood.h.

◆ canSaveGameStateCurrently()

bool Neverhood::NeverhoodEngine::canSaveGameStateCurrently ( )
inlinevirtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 123 of file neverhood.h.

◆ gameModule()

GameModule* Neverhood::NeverhoodEngine::gameModule ( )
inline

Definition at line 135 of file neverhood.h.

◆ gameState()

GameState& Neverhood::NeverhoodEngine::gameState ( )
inline

Definition at line 134 of file neverhood.h.

◆ getDebugger()

GUI::Debugger* Neverhood::NeverhoodEngine::getDebugger ( )
inlinevirtual

Return the engine's debugger instance, if any.

Used by error() to invoke the debugger when a severe error is reported.

Reimplemented from Engine.

Definition at line 93 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 207 of file neverhood.cpp.

◆ getMouseX()

int16 Neverhood::NeverhoodEngine::getMouseX ( ) const
inline

Definition at line 136 of file neverhood.h.

◆ getMouseY()

int16 Neverhood::NeverhoodEngine::getMouseY ( ) const
inline

Definition at line 137 of file neverhood.h.

◆ getPlatform()

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

Definition at line 51 of file detection.cpp.

◆ getSavegameFilename() [1/2]

const char * Neverhood::NeverhoodEngine::getSavegameFilename ( int  num)

Definition at line 153 of file saveload.cpp.

◆ getSavegameFilename() [2/2]

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

Definition at line 159 of file saveload.cpp.

◆ getTargetName()

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

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
virtual

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)
virtual

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 132 of file saveload.cpp.

◆ mainLoop()

void Neverhood::NeverhoodEngine::mainLoop ( )
protected

Definition at line 148 of file neverhood.cpp.

◆ musicIsEnabled()

bool Neverhood::NeverhoodEngine::musicIsEnabled ( )
inline

Definition at line 142 of file neverhood.h.

◆ readSaveHeader()

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

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 ( )
protectedvirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 67 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 
)
virtual

Save a game state.

Parameters
slotthe slot into which the savestate should be stored
desca description for the savestate, entered by the user
Returns
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)
inline

Definition at line 141 of file neverhood.h.

◆ toggleSoundUpdate()

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

Definition at line 140 of file neverhood.h.

Member Data Documentation

◆ _audioResourceMan

AudioResourceMan* Neverhood::NeverhoodEngine::_audioResourceMan

Definition at line 96 of file neverhood.h.

◆ _buttonState

uint16 Neverhood::NeverhoodEngine::_buttonState

Definition at line 84 of file neverhood.h.

◆ _console

Console* Neverhood::NeverhoodEngine::_console

Definition at line 92 of file neverhood.h.

◆ _enableMusic

bool Neverhood::NeverhoodEngine::_enableMusic
private

Definition at line 146 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 120 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 95 of file neverhood.h.

◆ _staticData

StaticData* Neverhood::NeverhoodEngine::_staticData

Definition at line 91 of file neverhood.h.

◆ _updateSound

bool Neverhood::NeverhoodEngine::_updateSound
private

Definition at line 145 of file neverhood.h.


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