ScummVM
Cine::CineEngine Class Reference

#include <cine.h>

+ Inheritance diagram for Cine::CineEngine:
+ Collaboration diagram for Cine::CineEngine:

Public Member Functions

 CineEngine (OSystem *syst, const CINEGameDescription *gameDesc)
 
 ~CineEngine () override
 
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...
 
int getGameType () const
 
uint32 getFeatures () const
 
Common::Language getLanguage () const
 
Common::Platform getPlatform () const
 
bool loadSaveDirectory ()
 
void makeSystemMenu ()
 
int scummVMSaveLoadDialog (bool isSave)
 
int modifyGameSpeed (int speedChange)
 Modify game speed. More...
 
int getTimerDelay () const
 
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...
 
virtual Common::String getSaveStateName (int slot) const override
 Generates the savegame filename. More...
 
bool canLoadGameStateCurrently () override
 Indicates whether a game state can be loaded. More...
 
bool canSaveGameStateCurrently () override
 Indicates whether a game state can be saved. More...
 
- 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)
 

Public Attributes

const CINEGameDescription_gameDescription
 
Common::File _partFileHandle
 
Common::RandomSource _rnd
 
Common::StringArray _volumeResourceFiles
 
StringPtrHashMap _volumeEntriesMap
 
TextHandler _textHandler
 
bool _restartRequested
 
Common::Array< AnimData_animDataTable
 
Common::List< BGIncrust_bgIncrustList
 
Common::StringArray _messageTable
 
Common::Array< ObjectStruct_objectTable
 
Common::List< overlay_overlayList
 
Common::Array< PalEntry_palArray
 
Common::Array< PartBuffer_partBuffer
 
ScriptList _globalScripts
 
ScriptList _objectScripts
 
RawObjectScriptArray _relTable
 Object script bytecode table. More...
 
ScriptVars _globalVars
 Global variables. More...
 
RawScriptArray _scriptTable
 Table of script bytecode. More...
 
Common::Array< uint16_zoneData
 
Common::Array< uint16_zoneQuery
 Only exists in Operation Stealth. More...
 
Common::List< SeqListElement_seqList
 
Common::String _commandBuffer
 
- 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...
 
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. 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 showSplashScreen ()
 
void resetEngine ()
 
bool loadPlainSaveFW (Common::SeekableReadStream &in, CineSaveGameFormat saveGameFormat)
 
bool loadTempSaveOS (Common::SeekableReadStream &in)
 
bool makeLoad (const Common::String &saveName)
 
void makeSaveFW (Common::OutSaveFile &out)
 
void makeSaveOS (Common::OutSaveFile &out)
 Save an Operation Stealth type savegame. More...
 
void makeSave (const Common::String &saveFileName)
 
void mainLoop (int bootScriptIdx)
 
void readVolCnf ()
 

Private Attributes

bool _preLoad
 
int _timerDelayMultiplier
 

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...
 
- 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...
 
- 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 102 of file cine.h.

Constructor & Destructor Documentation

◆ CineEngine()

Cine::CineEngine::CineEngine ( OSystem syst,
const CINEGameDescription gameDesc 
)

Definition at line 48 of file cine.cpp.

◆ ~CineEngine()

Cine::CineEngine::~CineEngine ( )
override

Definition at line 73 of file cine.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Cine::CineEngine::canLoadGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 256 of file detection.cpp.

◆ canSaveGameStateCurrently()

bool Cine::CineEngine::canSaveGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 260 of file detection.cpp.

◆ getFeatures()

uint32 Cine::CineEngine::getFeatures ( ) const

Definition at line 44 of file detection.cpp.

◆ getGameType()

int Cine::CineEngine::getGameType ( ) const

Definition at line 43 of file detection.cpp.

◆ getLanguage()

Common::Language Cine::CineEngine::getLanguage ( ) const

Definition at line 45 of file detection.cpp.

◆ getPlatform()

Common::Platform Cine::CineEngine::getPlatform ( ) const

Definition at line 46 of file detection.cpp.

◆ getSaveStateName()

Common::String Cine::CineEngine::getSaveStateName ( int  slot) const
overridevirtual

Generates the savegame filename.

Reimplemented from Engine.

Definition at line 252 of file detection.cpp.

◆ getTimerDelay()

int Cine::CineEngine::getTimerDelay ( ) const

Definition at line 138 of file cine.cpp.

◆ hasFeature()

bool Cine::CineEngine::hasFeature ( EngineFeature  f) const
overrideprotectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 108 of file detection.cpp.

◆ initGame()

bool Cine::CineEngine::initGame ( )
protected

◆ initialize()

void Cine::CineEngine::initialize ( )
private

Definition at line 153 of file cine.cpp.

◆ loadGameState()

Common::Error Cine::CineEngine::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 218 of file detection.cpp.

◆ loadPlainSaveFW()

bool Cine::CineEngine::loadPlainSaveFW ( Common::SeekableReadStream in,
CineSaveGameFormat  saveGameFormat 
)
private

Definition at line 654 of file saveload.cpp.

◆ loadSaveDirectory()

bool Cine::CineEngine::loadSaveDirectory ( )

Definition at line 461 of file saveload.cpp.

◆ loadTempSaveOS()

bool Cine::CineEngine::loadTempSaveOS ( Common::SeekableReadStream in)
private

Definition at line 484 of file saveload.cpp.

◆ mainLoop()

void Cine::CineEngine::mainLoop ( int  bootScriptIdx)
private

Definition at line 260 of file main_loop.cpp.

◆ makeLoad()

bool Cine::CineEngine::makeLoad ( const Common::String saveName)
private

Definition at line 782 of file saveload.cpp.

◆ makeSave()

void Cine::CineEngine::makeSave ( const Common::String saveFileName)
private

Definition at line 977 of file saveload.cpp.

◆ makeSaveFW()

void Cine::CineEngine::makeSaveFW ( Common::OutSaveFile out)
private

Definition at line 854 of file saveload.cpp.

◆ makeSaveOS()

void Cine::CineEngine::makeSaveOS ( Common::OutSaveFile out)
private

Save an Operation Stealth type savegame.

WIP!

NOTE: This is going to be very much a work in progress so the Operation Stealth's savegame formats that are going to be tried are extremely probably not going to be supported at all after Operation Stealth becomes officially supported. This means that the savegame format will hopefully change to something nicer when official support for Operation Stealth begins.

Definition at line 903 of file saveload.cpp.

◆ makeSystemMenu()

void Cine::CineEngine::makeSystemMenu ( )

Definition at line 391 of file various.cpp.

◆ modifyGameSpeed()

int Cine::CineEngine::modifyGameSpeed ( int  speedChange)

Modify game speed.

Parameters
speedChangeNegative values slow game down, positive values speed it up, zero does nothing
Returns
Timer delay multiplier's value after the game speed change

Definition at line 147 of file cine.cpp.

◆ readVolCnf()

void Cine::CineEngine::readVolCnf ( )
private

Definition at line 106 of file part.cpp.

◆ resetEngine()

void Cine::CineEngine::resetEngine ( )
private

Definition at line 291 of file various.cpp.

◆ run()

Common::Error Cine::CineEngine::run ( )
overrideprotectedvirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 95 of file cine.cpp.

◆ saveGameState()

Common::Error Cine::CineEngine::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 224 of file detection.cpp.

◆ scummVMSaveLoadDialog()

int Cine::CineEngine::scummVMSaveLoadDialog ( bool  isSave)

Definition at line 342 of file various.cpp.

◆ showSplashScreen()

void Cine::CineEngine::showSplashScreen ( )
private

Definition at line 256 of file cine.cpp.

◆ shutdown()

void Cine::CineEngine::shutdown ( )
protected

◆ syncSoundSettings()

void Cine::CineEngine::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 81 of file cine.cpp.

Member Data Documentation

◆ _animDataTable

Common::Array<AnimData> Cine::CineEngine::_animDataTable

Definition at line 165 of file cine.h.

◆ _bgIncrustList

Common::List<BGIncrust> Cine::CineEngine::_bgIncrustList

Definition at line 166 of file cine.h.

◆ _commandBuffer

Common::String Cine::CineEngine::_commandBuffer

Definition at line 190 of file cine.h.

◆ _gameDescription

const CINEGameDescription* Cine::CineEngine::_gameDescription

Definition at line 135 of file cine.h.

◆ _globalScripts

ScriptList Cine::CineEngine::_globalScripts

Definition at line 172 of file cine.h.

◆ _globalVars

ScriptVars Cine::CineEngine::_globalVars

Global variables.

255 of these are saved, but there's one more that's used for bypassing the copy protection. In CineEngine::mainLoop(int bootScriptIdx) there's this code: globalVars[VAR_BYPASS_PROTECTION] = 0; And as VAR_BYPASS_PROTECTION is 255 that's why we're allocating one more than we otherwise would.

Definition at line 182 of file cine.h.

◆ _messageTable

Common::StringArray Cine::CineEngine::_messageTable

Definition at line 167 of file cine.h.

◆ _objectScripts

ScriptList Cine::CineEngine::_objectScripts

Definition at line 173 of file cine.h.

◆ _objectTable

Common::Array<ObjectStruct> Cine::CineEngine::_objectTable

Definition at line 168 of file cine.h.

◆ _overlayList

Common::List<overlay> Cine::CineEngine::_overlayList

Definition at line 169 of file cine.h.

◆ _palArray

Common::Array<PalEntry> Cine::CineEngine::_palArray

Definition at line 170 of file cine.h.

◆ _partBuffer

Common::Array<PartBuffer> Cine::CineEngine::_partBuffer

Definition at line 171 of file cine.h.

◆ _partFileHandle

Common::File Cine::CineEngine::_partFileHandle

Definition at line 136 of file cine.h.

◆ _preLoad

bool Cine::CineEngine::_preLoad
private

Definition at line 159 of file cine.h.

◆ _relTable

RawObjectScriptArray Cine::CineEngine::_relTable

Object script bytecode table.

Definition at line 174 of file cine.h.

◆ _restartRequested

bool Cine::CineEngine::_restartRequested

Definition at line 144 of file cine.h.

◆ _rnd

Common::RandomSource Cine::CineEngine::_rnd

Definition at line 138 of file cine.h.

◆ _scriptTable

RawScriptArray Cine::CineEngine::_scriptTable

Table of script bytecode.

Definition at line 183 of file cine.h.

◆ _seqList

Common::List<SeqListElement> Cine::CineEngine::_seqList

Definition at line 188 of file cine.h.

◆ _textHandler

TextHandler Cine::CineEngine::_textHandler

Definition at line 142 of file cine.h.

◆ _timerDelayMultiplier

int Cine::CineEngine::_timerDelayMultiplier
private

Definition at line 160 of file cine.h.

◆ _volumeEntriesMap

StringPtrHashMap Cine::CineEngine::_volumeEntriesMap

Definition at line 141 of file cine.h.

◆ _volumeResourceFiles

Common::StringArray Cine::CineEngine::_volumeResourceFiles

Definition at line 140 of file cine.h.

◆ _zoneData

Common::Array<uint16> Cine::CineEngine::_zoneData

Definition at line 185 of file cine.h.

◆ _zoneQuery

Common::Array<uint16> Cine::CineEngine::_zoneQuery

Only exists in Operation Stealth.

Definition at line 186 of file cine.h.


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