ScummVM
Cruise::CruiseEngine Class Reference

#include <cruise.h>

+ Inheritance diagram for Cruise::CruiseEngine:
+ Collaboration diagram for Cruise::CruiseEngine:

Classes

struct  MemInfo
 

Public Types

typedef Common::List< Common::RectRectList
 
- 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

 CruiseEngine (OSystem *syst, const CRUISEGameDescription *gameDesc)
 
 ~ CruiseEngine () override
 
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. More...
 
int getGameType () const
 
const char * getGameId () const
 
uint32 getFeatures () const
 
Common::Language getLanguage () const
 
Common::Platform getPlatform () const
 
PCSoundsound ()
 
virtual void pauseEngine (bool pause)
 
const char * langString (LangStringId langId)
 
Common::Error loadGameState (int slot) override
 Load a game state. More...
 
bool canLoadGameStateCurrently () override
 Indicates whether a game state can be loaded. More...
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 Save a game state. More...
 
bool canSaveGameStateCurrently () override
 Indicates whether a game state can be saved. More...
 
Common::String getSaveStateName (int slot) const override
 Generates the savegame filename. More...
 
void syncSoundSettings () override
 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...
 
void initAllData ()
 
- 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 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 const char * getSavegameFile (int saveGameIdx)
 
- 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 CRUISEGameDescription_gameDescription
 
Common::RandomSource _rnd
 
Common::List< MemInfo * > _memList
 
RectList _dirtyRects
 
RectList _priorFrameRects
 
Common::File _currentVolumeFile
 
Common::Array< CtStruct_polyStructNorm
 
Common::Array< CtStruct_polyStructExp
 
Common::Array< CtStruct > * _polyStructs
 
Common::Array< CtStruct > * _polyStruct
 
Common::File _PAL_file
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

Common::Error run () override
 Init the engine and start its main loop. More...
 
void shutdown ()
 
bool initGame ()
 
- 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 Member Functions

void initialize ()
 
void deinitialize ()
 
bool loadLanguageStrings ()
 
void mainLoop ()
 
int processInput ()
 

Private Attributes

bool _preLoad
 
PCSound_sound
 
Common::StringArray _langStrings
 
CursorType _savedCursor
 
uint32 _lastTick
 
int _gameSpeed
 
bool _speedFlag
 

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 56 of file cruise.h.

Member Typedef Documentation

◆ RectList

Constructor & Destructor Documentation

◆ CruiseEngine()

Cruise::CruiseEngine::CruiseEngine ( OSystem syst,
const CRUISEGameDescription gameDesc 
)

Definition at line 43 of file cruise.cpp.

◆ ~ CruiseEngine()

Cruise::CruiseEngine::~ CruiseEngine ( )
override

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Cruise::CruiseEngine::canLoadGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 204 of file cruise.cpp.

◆ canSaveGameStateCurrently()

bool Cruise::CruiseEngine::canSaveGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 212 of file cruise.cpp.

◆ deinitialize()

void Cruise::CruiseEngine::deinitialize ( )
private

Definition at line 114 of file cruise.cpp.

◆ getFeatures()

uint32 Cruise::CruiseEngine::getFeatures ( ) const

◆ getGameId()

const char * Cruise::CruiseEngine::getGameId ( ) const

Definition at line 37 of file detection.cpp.

◆ getGameType()

int Cruise::CruiseEngine::getGameType ( ) const

◆ getLanguage()

Common::Language Cruise::CruiseEngine::getLanguage ( ) const

Definition at line 41 of file detection.cpp.

◆ getPlatform()

Common::Platform Cruise::CruiseEngine::getPlatform ( ) const

Definition at line 44 of file detection.cpp.

◆ getSavegameFile()

const char * Cruise::CruiseEngine::getSavegameFile ( int  saveGameIdx)
static

Definition at line 216 of file cruise.cpp.

◆ getSaveStateName()

Common::String Cruise::CruiseEngine::getSaveStateName ( int  slot) const
inlineoverridevirtual

Generates the savegame filename.

Reimplemented from Engine.

Definition at line 98 of file cruise.h.

◆ hasFeature()

bool Cruise::CruiseEngine::hasFeature ( EngineFeature  f) const
overridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 77 of file cruise.cpp.

◆ initAllData()

void Cruise::CruiseEngine::initAllData ( )

Definition at line 435 of file cruise_main.cpp.

◆ initGame()

bool Cruise::CruiseEngine::initGame ( )
protected

◆ initialize()

void Cruise::CruiseEngine::initialize ( )
private

Definition at line 105 of file cruise.cpp.

◆ langString()

const char* Cruise::CruiseEngine::langString ( LangStringId  langId)
inline

Definition at line 91 of file cruise.h.

◆ loadGameState()

Common::Error Cruise::CruiseEngine::loadGameState ( int  slot)
overridevirtual

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 200 of file cruise.cpp.

◆ loadLanguageStrings()

bool Cruise::CruiseEngine::loadLanguageStrings ( )
private

Definition at line 127 of file cruise.cpp.

◆ mainLoop()

void Cruise::CruiseEngine::mainLoop ( )
private

Definition at line 1756 of file cruise_main.cpp.

◆ pauseEngine()

void Cruise::CruiseEngine::pauseEngine ( bool  pause)
virtual

Definition at line 180 of file cruise.cpp.

◆ processInput()

int Cruise::CruiseEngine::processInput ( )
private

Definition at line 1391 of file cruise_main.cpp.

◆ run()

Common::Error Cruise::CruiseEngine::run ( )
overrideprotectedvirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 84 of file cruise.cpp.

◆ saveGameState()

Common::Error Cruise::CruiseEngine::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave = false 
)
overridevirtual

Save a game state.

Parameters
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
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 208 of file cruise.cpp.

◆ shutdown()

void Cruise::CruiseEngine::shutdown ( )
protected

◆ sound()

PCSound& Cruise::CruiseEngine::sound ( )
inline

Definition at line 89 of file cruise.h.

◆ syncSoundSettings()

void Cruise::CruiseEngine::syncSoundSettings ( )
overridevirtual

Notify the engine that the sound settings in the config manager may have changed and that it hence should adjust any internal volume etc.

values accordingly. The default implementation sets the volume levels of all mixer sound types according to the config entries of the active domain. When overwriting, call the default implementation first, then adjust the volumes further (if required).

Note
When setting volume levels, respect the "mute" config entry.
The volume for the plain sound type is reset to the maximum volume. If the engine can associate its own value for this type, it needs to overwrite this member and set it accordingly.
Todo:
find a better name for this

Reimplemented from Engine.

Definition at line 222 of file cruise.cpp.

Member Data Documentation

◆ _currentVolumeFile

Common::File Cruise::CruiseEngine::_currentVolumeFile

Definition at line 121 of file cruise.h.

◆ _dirtyRects

RectList Cruise::CruiseEngine::_dirtyRects

Definition at line 118 of file cruise.h.

◆ _gameDescription

const CRUISEGameDescription* Cruise::CruiseEngine::_gameDescription

Definition at line 101 of file cruise.h.

◆ _gameSpeed

int Cruise::CruiseEngine::_gameSpeed
private

Definition at line 63 of file cruise.h.

◆ _langStrings

Common::StringArray Cruise::CruiseEngine::_langStrings
private

Definition at line 60 of file cruise.h.

◆ _lastTick

uint32 Cruise::CruiseEngine::_lastTick
private

Definition at line 62 of file cruise.h.

◆ _memList

Common::List<MemInfo *> Cruise::CruiseEngine::_memList

Definition at line 114 of file cruise.h.

◆ _PAL_file

Common::File Cruise::CruiseEngine::_PAL_file

Definition at line 128 of file cruise.h.

◆ _polyStruct

Common::Array<CtStruct>* Cruise::CruiseEngine::_polyStruct

Definition at line 126 of file cruise.h.

◆ _polyStructExp

Common::Array<CtStruct> Cruise::CruiseEngine::_polyStructExp

Definition at line 124 of file cruise.h.

◆ _polyStructNorm

Common::Array<CtStruct> Cruise::CruiseEngine::_polyStructNorm

Definition at line 123 of file cruise.h.

◆ _polyStructs

Common::Array<CtStruct>* Cruise::CruiseEngine::_polyStructs

Definition at line 125 of file cruise.h.

◆ _preLoad

bool Cruise::CruiseEngine::_preLoad
private

Definition at line 58 of file cruise.h.

◆ _priorFrameRects

RectList Cruise::CruiseEngine::_priorFrameRects

Definition at line 119 of file cruise.h.

◆ _rnd

Common::RandomSource Cruise::CruiseEngine::_rnd

Definition at line 104 of file cruise.h.

◆ _savedCursor

CursorType Cruise::CruiseEngine::_savedCursor
private

Definition at line 61 of file cruise.h.

◆ _sound

PCSound* Cruise::CruiseEngine::_sound
private

Definition at line 59 of file cruise.h.

◆ _speedFlag

bool Cruise::CruiseEngine::_speedFlag
private

Definition at line 64 of file cruise.h.


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