ScummVM
Titanic::TitanicEngine Class Reference

#include <titanic.h>

Inheritance diagram for Titanic::TitanicEngine:
Collaboration diagram for Titanic::TitanicEngine:

Public Member Functions

 TitanicEngine (OSystem *syst, const TitanicGameDescription *gameDesc)
 
virtual ~TitanicEngine ()
 
virtual bool canLoadGameStateCurrently ()
 Returns true if a savegame can be loaded. More...
 
virtual bool canSaveGameStateCurrently ()
 Returns true if the game can be saved. More...
 
virtual Common::Error loadGameState (int slot)
 Called by the GMM to load a savegame. More...
 
virtual Common::Error saveGameState (int slot, const Common::String &desc)
 Called by the GMM to save the game. More...
 
virtual void syncSoundSettings ()
 Handles updates to the sound levels. More...
 
uint32 getFeatures () const
 Gets the game features. More...
 
Common::Language getLanguage () const
 Returns the language for the game. More...
 
bool isGerman () const
 Returns true if it's the German version. More...
 
uint getRandomNumber (uint max)
 Returns a uniform random unsigned integer in the interval [0, max]. More...
 
double getRandomFloat ()
 Returns a uniform random floating point number in the interval [0.0, 65535.0]. More...
 
CString generateSaveName (int slot)
 Support method that generates a savegame name. More...
 
CString getSavegameName (int slot)
 Checks whether a savegame exists for the given slot, and if it exists, returns it's description. More...
 
void showScummVMSaveDialog ()
 Shows the ScummVM GMM save dialog. More...
 
void showScummVMRestoreDialog ()
 Shows the ScummVM GMM load dialog. More...
 
- 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 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...
 
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...
 

Public Attributes

Debugger_debugger
 
Events_events
 
CFilesManager_filesManager
 
CMovieManager _movieManager
 
Graphics::Screen_screen
 
OSScreenManager_screenManager
 
CMainGameWindow_window
 
Common::RandomSource _randomSource
 
CScriptHandler_scriptHandler
 
TTscriptBase_script
 
CTrueTalkManager_trueTalkManager
 
CExeResources _exeResources
 
StringArray _itemNames
 
StringArray _itemDescriptions
 
StringArray _itemIds
 
StringArray _roomNames
 
Strings _strings
 
CString _stateRoomExitView
 
int _loadSaveSlot
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

virtual void initializePath (const Common::FSNode &gamePath)
 Init SearchMan according to the game path. More...
 
virtual Common::Error run ()
 Init the engine and start its main loop. More...
 
virtual bool hasFeature (EngineFeature f) const
 Determine whether the engine supports the specified feature. More...
 
- 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...
 

Protected Attributes

const TitanicGameDescription_gameDescription
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Private Member Functions

bool initialize ()
 Handles basic initialization. More...
 
void deinitialize ()
 Handles game deinitialization. More...
 
void setItemNames ()
 Sets up the item names, short, and long descriptions. More...
 
void setRoomNames ()
 Sets up the list of room names. More...
 

Additional Inherited Members

- 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...
 
- 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...
 

Detailed Description

Definition at line 83 of file titanic.h.

Constructor & Destructor Documentation

◆ TitanicEngine()

Titanic::TitanicEngine::TitanicEngine ( OSystem syst,
const TitanicGameDescription gameDesc 
)

Definition at line 60 of file titanic.cpp.

◆ ~TitanicEngine()

Titanic::TitanicEngine::~TitanicEngine ( )
virtual

Definition at line 82 of file titanic.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Titanic::TitanicEngine::canLoadGameStateCurrently ( )
virtual

Returns true if a savegame can be loaded.

Reimplemented from Engine.

Definition at line 190 of file titanic.cpp.

◆ canSaveGameStateCurrently()

bool Titanic::TitanicEngine::canSaveGameStateCurrently ( )
virtual

Returns true if the game can be saved.

Reimplemented from Engine.

Definition at line 219 of file titanic.cpp.

◆ deinitialize()

void Titanic::TitanicEngine::deinitialize ( )
private

Handles game deinitialization.

Definition at line 130 of file titanic.cpp.

◆ generateSaveName()

CString Titanic::TitanicEngine::generateSaveName ( int  slot)

Support method that generates a savegame name.

Parameters
slotSlot number

Definition at line 242 of file titanic.cpp.

◆ getFeatures()

uint32 Titanic::TitanicEngine::getFeatures ( ) const

Gets the game features.

Definition at line 42 of file detection.cpp.

◆ getLanguage()

Common::Language Titanic::TitanicEngine::getLanguage ( ) const

Returns the language for the game.

Definition at line 46 of file detection.cpp.

◆ getRandomFloat()

double Titanic::TitanicEngine::getRandomFloat ( )
inline

Returns a uniform random floating point number in the interval [0.0, 65535.0].

Definition at line 184 of file titanic.h.

◆ getRandomNumber()

uint Titanic::TitanicEngine::getRandomNumber ( uint  max)
inline

Returns a uniform random unsigned integer in the interval [0, max].

Definition at line 179 of file titanic.h.

◆ getSavegameName()

CString Titanic::TitanicEngine::getSavegameName ( int  slot)

Checks whether a savegame exists for the given slot, and if it exists, returns it's description.

Definition at line 246 of file titanic.cpp.

◆ hasFeature()

bool Titanic::TitanicEngine::hasFeature ( EngineFeature  f) const
protectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 97 of file detection.cpp.

◆ initialize()

bool Titanic::TitanicEngine::initialize ( )
private

Handles basic initialization.

Definition at line 90 of file titanic.cpp.

◆ initializePath()

void Titanic::TitanicEngine::initializePath ( const Common::FSNode gamePath)
protectedvirtual

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.

Parameters
gamePathThe base directory of the game data.

Reimplemented from Engine.

Definition at line 85 of file titanic.cpp.

◆ isGerman()

bool Titanic::TitanicEngine::isGerman ( ) const
inline

Returns true if it's the German version.

Definition at line 174 of file titanic.h.

◆ loadGameState()

Common::Error Titanic::TitanicEngine::loadGameState ( int  slot)
virtual

Called by the GMM to load a savegame.

Reimplemented from Engine.

Definition at line 228 of file titanic.cpp.

◆ run()

Common::Error Titanic::TitanicEngine::run ( )
protectedvirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 152 of file titanic.cpp.

◆ saveGameState()

Common::Error Titanic::TitanicEngine::saveGameState ( int  slot,
const Common::String desc 
)
virtual

Called by the GMM to save the game.

Reimplemented from Engine.

Definition at line 237 of file titanic.cpp.

◆ setItemNames()

void Titanic::TitanicEngine::setItemNames ( )
private

Sets up the item names, short, and long descriptions.

Definition at line 165 of file titanic.cpp.

◆ setRoomNames()

void Titanic::TitanicEngine::setRoomNames ( )
private

Sets up the list of room names.

Definition at line 183 of file titanic.cpp.

◆ showScummVMRestoreDialog()

void Titanic::TitanicEngine::showScummVMRestoreDialog ( )

Shows the ScummVM GMM load dialog.

Definition at line 305 of file titanic.cpp.

◆ showScummVMSaveDialog()

void Titanic::TitanicEngine::showScummVMSaveDialog ( )

Shows the ScummVM GMM save dialog.

Definition at line 280 of file titanic.cpp.

◆ syncSoundSettings()

void Titanic::TitanicEngine::syncSoundSettings ( )
virtual

Handles updates to the sound levels.

Reimplemented from Engine.

Definition at line 268 of file titanic.cpp.

Member Data Documentation

◆ _debugger

Debugger* Titanic::TitanicEngine::_debugger

Definition at line 112 of file titanic.h.

◆ _events

Events* Titanic::TitanicEngine::_events

Definition at line 113 of file titanic.h.

◆ _exeResources

CExeResources Titanic::TitanicEngine::_exeResources

Definition at line 123 of file titanic.h.

◆ _filesManager

CFilesManager* Titanic::TitanicEngine::_filesManager

Definition at line 114 of file titanic.h.

◆ _gameDescription

const TitanicGameDescription* Titanic::TitanicEngine::_gameDescription
protected

Definition at line 105 of file titanic.h.

◆ _itemDescriptions

StringArray Titanic::TitanicEngine::_itemDescriptions

Definition at line 125 of file titanic.h.

◆ _itemIds

StringArray Titanic::TitanicEngine::_itemIds

Definition at line 126 of file titanic.h.

◆ _itemNames

StringArray Titanic::TitanicEngine::_itemNames

Definition at line 124 of file titanic.h.

◆ _loadSaveSlot

int Titanic::TitanicEngine::_loadSaveSlot

Definition at line 130 of file titanic.h.

◆ _movieManager

CMovieManager Titanic::TitanicEngine::_movieManager

Definition at line 115 of file titanic.h.

◆ _randomSource

Common::RandomSource Titanic::TitanicEngine::_randomSource

Definition at line 119 of file titanic.h.

◆ _roomNames

StringArray Titanic::TitanicEngine::_roomNames

Definition at line 127 of file titanic.h.

◆ _screen

Graphics::Screen* Titanic::TitanicEngine::_screen

Definition at line 116 of file titanic.h.

◆ _screenManager

OSScreenManager* Titanic::TitanicEngine::_screenManager

Definition at line 117 of file titanic.h.

◆ _script

TTscriptBase* Titanic::TitanicEngine::_script

Definition at line 121 of file titanic.h.

◆ _scriptHandler

CScriptHandler* Titanic::TitanicEngine::_scriptHandler

Definition at line 120 of file titanic.h.

◆ _stateRoomExitView

CString Titanic::TitanicEngine::_stateRoomExitView

Definition at line 129 of file titanic.h.

◆ _strings

Strings Titanic::TitanicEngine::_strings

Definition at line 128 of file titanic.h.

◆ _trueTalkManager

CTrueTalkManager* Titanic::TitanicEngine::_trueTalkManager

Definition at line 122 of file titanic.h.

◆ _window

CMainGameWindow* Titanic::TitanicEngine::_window

Definition at line 118 of file titanic.h.


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