Illusions::IllusionsEngine Class Referenceabstract

#include <illusions.h>

+ Inheritance diagram for Illusions::IllusionsEngine:
+ Collaboration diagram for Illusions::IllusionsEngine:


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

 IllusionsEngine (OSystem *syst, const IllusionsGameDescription *gd)
 ~IllusionsEngine () override
const Common::String getTargetName ()
void updateEvents ()
int getGameId () const
void runUpdateFunctions ()
int updateActors (uint flags)
int updateSequences (uint flags)
int updateGraphics (uint flags)
int updateSoundMan (uint flags)
int updateSprites (uint flags)
uint32 getElapsedUpdateTime ()
Common::PointgetObjectActorPositionPtr (uint32 objectId)
int getRandom (int max)
int convertPanXCoord (int16 x)
bool calcPointDirection (Common::Point &srcPt, Common::Point &dstPt, uint &facing)
bool isSoundActive ()
virtual void updateFader ()
virtual void clearFader ()
virtual void pauseFader ()
virtual void unpauseFader ()
virtual bool isVideoPlaying ()
void setCurrFontId (uint32 fontId)
bool checkActiveTalkThreads ()
void setTextDuration (int kind, uint32 duration)
uint32 clipTextDuration (uint32 duration)
void getDefaultTextDimensions (WidthHeight &dimensions)
void setDefaultTextDimensions (WidthHeight &dimensions)
void getDefaultTextPosition (Common::Point &position)
void setDefaultTextPosition (Common::Point &position)
uint16 getSubtitleDuration ()
void setSubtitleDuration (uint16 duration)
FramesListfindActorSequenceFrames (Sequence *sequence)
virtual void setDefaultTextCoords ()=0
virtual void loadSpecialCode (uint32 resId)=0
virtual void unloadSpecialCode (uint32 resId)=0
virtual void notifyThreadId (uint32 &threadId)=0
virtual bool testMainActorFastWalk (Control *control)=0
virtual bool testMainActorCollision (Control *control)=0
virtual ControlgetObjectControl (uint32 objectId)=0
virtual Common::Point getNamedPointPosition (uint32 namedPointId)=0
virtual uint32 getPriorityFromBase (int16 priority)=0
virtual uint32 getPrevScene ()=0
virtual uint32 getCurrentScene ()=0
virtual bool isCursorObject (uint32 actorTypeId, uint32 objectId)=0
virtual void setCursorControlRoutine (Control *control)=0
virtual void placeCursorControl (Control *control, uint32 sequenceId)=0
virtual void setCursorControl (Control *control)=0
virtual void showCursor ()=0
virtual void hideCursor ()=0
virtual void startScriptThreadSimple (uint32 threadId, uint32 callingThreadId)=0
virtual uint32 startTempScriptThread (byte *scriptCodeIp, uint32 callingThreadId, uint32 value8, uint32 valueC, uint32 value10)=0
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 &desc, 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)
const char * getSavegameFilename (int num)
bool existsSavegame (int num)
- 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 Common::Error run ()=0
 Init the engine and start its main loop. 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 bool hasFeature (EngineFeature f) const
 Determine whether the engine supports the specified feature. 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::String getSaveStateName (int slot) const
 Generates the savegame filename. 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 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

uint32 _nextTempThreadId
bool _doScriptThreadInit
bool _rerunThreads
int _pauseCtr
int _resGetCtr
uint32 _resGetTime
bool _unpauseControlActorFlag
uint32 _lastUpdateTime
int _resumeFromSavegameRequested
int _savegameSlotNum
Common::String _savegameDescription
uint32 _savegameSceneId
uint32 _savegameThreadId
uint32 _fontId
int _field8
uint32 _fieldA
uint32 _subtitleDuration
WidthHeight _defaultTextDimensions
Common::Point _defaultTextPosition
int16 _menuChoiceOfs
bool _isSaveAllowed
- Public Attributes inherited from Engine

Private Attributes

const IllusionsGameDescription_gameDescription
Graphics::PixelFormat _pixelFormat

Additional Inherited Members

- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...
- Protected Attributes inherited from Engine
const Common::String _targetName

Detailed Description

Definition at line 83 of file illusions.h.

Member Enumeration Documentation

◆ kReadSaveHeaderError


Definition at line 206 of file illusions.h.

Constructor & Destructor Documentation

◆ IllusionsEngine()

Illusions::IllusionsEngine::IllusionsEngine ( OSystem syst,
const IllusionsGameDescription gd 

Definition at line 77 of file illusions.cpp.

◆ ~IllusionsEngine()

Illusions::IllusionsEngine::~IllusionsEngine ( )

Definition at line 95 of file illusions.cpp.

Member Function Documentation

◆ calcPointDirection()

bool Illusions::IllusionsEngine::calcPointDirection ( Common::Point srcPt,
Common::Point dstPt,
uint facing 

Definition at line 246 of file illusions.cpp.

◆ canLoadGameStateCurrently()

bool Illusions::IllusionsEngine::canLoadGameStateCurrently ( )

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 226 of file illusions.h.

◆ canSaveGameStateCurrently()

bool Illusions::IllusionsEngine::canSaveGameStateCurrently ( )

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 227 of file illusions.h.

◆ checkActiveTalkThreads()

bool Illusions::IllusionsEngine::checkActiveTalkThreads ( )

Definition at line 287 of file illusions.cpp.

◆ clearFader()

virtual void Illusions::IllusionsEngine::clearFader ( )

Reimplemented in Illusions::IllusionsEngine_Duckman.

Definition at line 164 of file illusions.h.

◆ clipTextDuration()

uint32 Illusions::IllusionsEngine::clipTextDuration ( uint32  duration)

Definition at line 307 of file illusions.cpp.

◆ convertPanXCoord()

int Illusions::IllusionsEngine::convertPanXCoord ( int16  x)

Definition at line 230 of file illusions.cpp.

◆ existsSavegame()

bool Illusions::IllusionsEngine::existsSavegame ( int  num)

◆ findActorSequenceFrames()

FramesList * Illusions::IllusionsEngine::findActorSequenceFrames ( Sequence sequence)

Definition at line 343 of file illusions.cpp.

◆ getCurrentScene()

virtual uint32 Illusions::IllusionsEngine::getCurrentScene ( )
pure virtual

◆ getDefaultTextDimensions()

void Illusions::IllusionsEngine::getDefaultTextDimensions ( WidthHeight dimensions)

Definition at line 327 of file illusions.cpp.

◆ getDefaultTextPosition()

void Illusions::IllusionsEngine::getDefaultTextPosition ( Common::Point position)

Definition at line 335 of file illusions.cpp.

◆ getElapsedUpdateTime()

uint32 Illusions::IllusionsEngine::getElapsedUpdateTime ( )

Definition at line 126 of file illusions.cpp.

◆ getGameId()

int Illusions::IllusionsEngine::getGameId ( ) const

Definition at line 47 of file detection.cpp.

◆ getNamedPointPosition()

virtual Common::Point Illusions::IllusionsEngine::getNamedPointPosition ( uint32  namedPointId)
pure virtual

◆ getObjectActorPositionPtr()

Common::Point * Illusions::IllusionsEngine::getObjectActorPositionPtr ( uint32  objectId)

Definition at line 119 of file illusions.cpp.

◆ getObjectControl()

virtual Control* Illusions::IllusionsEngine::getObjectControl ( uint32  objectId)
pure virtual

◆ getPrevScene()

virtual uint32 Illusions::IllusionsEngine::getPrevScene ( )
pure virtual

◆ getPriorityFromBase()

virtual uint32 Illusions::IllusionsEngine::getPriorityFromBase ( int16  priority)
pure virtual

◆ getRandom()

int Illusions::IllusionsEngine::getRandom ( int  max)

Definition at line 226 of file illusions.cpp.

◆ getSavegameFilename() [1/2]

Common::String Illusions::IllusionsEngine::getSavegameFilename ( const Common::String target,
int  num 

Definition at line 157 of file saveload.cpp.

◆ getSavegameFilename() [2/2]

const char * Illusions::IllusionsEngine::getSavegameFilename ( int  num)

Definition at line 151 of file saveload.cpp.

◆ getSubtitleDuration()

uint16 Illusions::IllusionsEngine::getSubtitleDuration ( )

Definition at line 353 of file illusions.cpp.

◆ getTargetName()

const Common::String Illusions::IllusionsEngine::getTargetName ( )

Definition at line 87 of file illusions.h.

◆ hideCursor()

virtual void Illusions::IllusionsEngine::hideCursor ( )
pure virtual

◆ isCursorObject()

virtual bool Illusions::IllusionsEngine::isCursorObject ( uint32  actorTypeId,
uint32  objectId 
pure virtual

◆ isSoundActive()

bool Illusions::IllusionsEngine::isSoundActive ( )

Definition at line 278 of file illusions.cpp.

◆ isVideoPlaying()

virtual bool Illusions::IllusionsEngine::isVideoPlaying ( )

Reimplemented in Illusions::IllusionsEngine_Duckman, and Illusions::IllusionsEngine_BBDOU.

Definition at line 167 of file illusions.h.

◆ loadgame()

bool Illusions::IllusionsEngine::loadgame ( const char *  filename)

Definition at line 102 of file saveload.cpp.

◆ loadGameState()

Common::Error Illusions::IllusionsEngine::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 127 of file saveload.cpp.

◆ loadSpecialCode()

virtual void Illusions::IllusionsEngine::loadSpecialCode ( uint32  resId)
pure virtual

◆ notifyThreadId()

virtual void Illusions::IllusionsEngine::notifyThreadId ( uint32 threadId)
pure virtual

◆ pauseFader()

virtual void Illusions::IllusionsEngine::pauseFader ( )

Reimplemented in Illusions::IllusionsEngine_Duckman.

Definition at line 165 of file illusions.h.

◆ placeCursorControl()

virtual void Illusions::IllusionsEngine::placeCursorControl ( Control control,
uint32  sequenceId 
pure virtual

◆ readSaveHeader()

IllusionsEngine::kReadSaveHeaderError Illusions::IllusionsEngine::readSaveHeader ( Common::SeekableReadStream in,
SaveHeader header,
bool  skipThumbnail = true 

Definition at line 34 of file saveload.cpp.

◆ removeGameState()

Common::Error Illusions::IllusionsEngine::removeGameState ( int  slot)

Definition at line 144 of file saveload.cpp.

◆ runUpdateFunctions()

void Illusions::IllusionsEngine::runUpdateFunctions ( )

Definition at line 115 of file illusions.cpp.

◆ savegame()

bool Illusions::IllusionsEngine::savegame ( const char *  filename,
const char *  description 

Definition at line 61 of file saveload.cpp.

◆ saveGameState()

Common::Error Illusions::IllusionsEngine::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 137 of file saveload.cpp.

◆ setCurrFontId()

void Illusions::IllusionsEngine::setCurrFontId ( uint32  fontId)

Definition at line 283 of file illusions.cpp.

◆ setCursorControl()

virtual void Illusions::IllusionsEngine::setCursorControl ( Control control)
pure virtual

◆ setCursorControlRoutine()

virtual void Illusions::IllusionsEngine::setCursorControlRoutine ( Control control)
pure virtual

◆ setDefaultTextCoords()

virtual void Illusions::IllusionsEngine::setDefaultTextCoords ( )
pure virtual

◆ setDefaultTextDimensions()

void Illusions::IllusionsEngine::setDefaultTextDimensions ( WidthHeight dimensions)

Definition at line 331 of file illusions.cpp.

◆ setDefaultTextPosition()

void Illusions::IllusionsEngine::setDefaultTextPosition ( Common::Point position)

Definition at line 339 of file illusions.cpp.

◆ setSubtitleDuration()

void Illusions::IllusionsEngine::setSubtitleDuration ( uint16  duration)

Definition at line 347 of file illusions.cpp.

◆ setTextDuration()

void Illusions::IllusionsEngine::setTextDuration ( int  kind,
uint32  duration 

Definition at line 291 of file illusions.cpp.

◆ showCursor()

virtual void Illusions::IllusionsEngine::showCursor ( )
pure virtual

◆ startScriptThreadSimple()

virtual void Illusions::IllusionsEngine::startScriptThreadSimple ( uint32  threadId,
uint32  callingThreadId 
pure virtual

◆ startTempScriptThread()

virtual uint32 Illusions::IllusionsEngine::startTempScriptThread ( byte scriptCodeIp,
uint32  callingThreadId,
uint32  value8,
uint32  valueC,
uint32  value10 
pure virtual

◆ testMainActorCollision()

virtual bool Illusions::IllusionsEngine::testMainActorCollision ( Control control)
pure virtual

◆ testMainActorFastWalk()

virtual bool Illusions::IllusionsEngine::testMainActorFastWalk ( Control control)
pure virtual

◆ unloadSpecialCode()

virtual void Illusions::IllusionsEngine::unloadSpecialCode ( uint32  resId)
pure virtual

◆ unpauseFader()

virtual void Illusions::IllusionsEngine::unpauseFader ( )

Reimplemented in Illusions::IllusionsEngine_Duckman.

Definition at line 166 of file illusions.h.

◆ updateActors()

int Illusions::IllusionsEngine::updateActors ( uint  flags)

Definition at line 144 of file illusions.cpp.

◆ updateEvents()

void Illusions::IllusionsEngine::updateEvents ( )

Definition at line 101 of file illusions.cpp.

◆ updateFader()

virtual void Illusions::IllusionsEngine::updateFader ( )

Reimplemented in Illusions::IllusionsEngine_Duckman.

Definition at line 163 of file illusions.h.

◆ updateGraphics()

int Illusions::IllusionsEngine::updateGraphics ( uint  flags)

Definition at line 164 of file illusions.cpp.

◆ updateSequences()

int Illusions::IllusionsEngine::updateSequences ( uint  flags)

Definition at line 154 of file illusions.cpp.

◆ updateSoundMan()

int Illusions::IllusionsEngine::updateSoundMan ( uint  flags)

Definition at line 215 of file illusions.cpp.

◆ updateSprites()

int Illusions::IllusionsEngine::updateSprites ( uint  flags)

Definition at line 220 of file illusions.cpp.

Member Data Documentation

◆ _actorInstances

ActorInstanceList* Illusions::IllusionsEngine::_actorInstances

Definition at line 106 of file illusions.h.

◆ _backgroundInstances

BackgroundInstanceList* Illusions::IllusionsEngine::_backgroundInstances

Definition at line 107 of file illusions.h.

◆ _camera

Camera* Illusions::IllusionsEngine::_camera

Definition at line 108 of file illusions.h.

◆ _controls

Controls* Illusions::IllusionsEngine::_controls

Definition at line 109 of file illusions.h.

◆ _defaultTextDimensions

WidthHeight Illusions::IllusionsEngine::_defaultTextDimensions

Definition at line 142 of file illusions.h.

◆ _defaultTextPosition

Common::Point Illusions::IllusionsEngine::_defaultTextPosition

Definition at line 143 of file illusions.h.

◆ _dict

Dictionary* Illusions::IllusionsEngine::_dict

Definition at line 94 of file illusions.h.

◆ _doScriptThreadInit

bool Illusions::IllusionsEngine::_doScriptThreadInit

Definition at line 117 of file illusions.h.

◆ _fader

Fader* Illusions::IllusionsEngine::_fader

Definition at line 122 of file illusions.h.

◆ _field8

int Illusions::IllusionsEngine::_field8

Definition at line 138 of file illusions.h.

◆ _fieldA

uint32 Illusions::IllusionsEngine::_fieldA

Definition at line 139 of file illusions.h.

◆ _fontId

uint32 Illusions::IllusionsEngine::_fontId

Definition at line 137 of file illusions.h.

◆ _gameDescription

const IllusionsGameDescription* Illusions::IllusionsEngine::_gameDescription

Definition at line 89 of file illusions.h.

◆ _gameState

GameState* Illusions::IllusionsEngine::_gameState

Definition at line 98 of file illusions.h.

◆ _input

Input* Illusions::IllusionsEngine::_input

Definition at line 105 of file illusions.h.

◆ _isSaveAllowed

bool Illusions::IllusionsEngine::_isSaveAllowed

Definition at line 224 of file illusions.h.

◆ _lastUpdateTime

uint32 Illusions::IllusionsEngine::_lastUpdateTime

Definition at line 129 of file illusions.h.

◆ _menuChoiceOfs

int16 Illusions::IllusionsEngine::_menuChoiceOfs

Definition at line 145 of file illusions.h.

◆ _nextTempThreadId

uint32 Illusions::IllusionsEngine::_nextTempThreadId

Definition at line 116 of file illusions.h.

◆ _pauseCtr

int Illusions::IllusionsEngine::_pauseCtr

Definition at line 124 of file illusions.h.

◆ _pixelFormat

Graphics::PixelFormat Illusions::IllusionsEngine::_pixelFormat

Definition at line 90 of file illusions.h.

◆ _random

Common::RandomSource* Illusions::IllusionsEngine::_random

Definition at line 93 of file illusions.h.

◆ _rerunThreads

bool Illusions::IllusionsEngine::_rerunThreads

Definition at line 120 of file illusions.h.

◆ _resGetCtr

int Illusions::IllusionsEngine::_resGetCtr

Definition at line 126 of file illusions.h.

◆ _resGetTime

uint32 Illusions::IllusionsEngine::_resGetTime

Definition at line 127 of file illusions.h.

◆ _resReader

BaseResourceReader* Illusions::IllusionsEngine::_resReader

Definition at line 96 of file illusions.h.

◆ _resSys

ResourceSystem* Illusions::IllusionsEngine::_resSys

Definition at line 95 of file illusions.h.

◆ _resumeFromSavegameRequested

int Illusions::IllusionsEngine::_resumeFromSavegameRequested

Definition at line 131 of file illusions.h.

◆ _savegameDescription

Common::String Illusions::IllusionsEngine::_savegameDescription

Definition at line 133 of file illusions.h.

◆ _savegameSceneId

uint32 Illusions::IllusionsEngine::_savegameSceneId

Definition at line 134 of file illusions.h.

◆ _savegameSlotNum

int Illusions::IllusionsEngine::_savegameSlotNum

Definition at line 132 of file illusions.h.

◆ _savegameThreadId

uint32 Illusions::IllusionsEngine::_savegameThreadId

Definition at line 135 of file illusions.h.

◆ _screen

Screen* Illusions::IllusionsEngine::_screen

Definition at line 102 of file illusions.h.

◆ _screenPalette

ScreenPaletteBase* Illusions::IllusionsEngine::_screenPalette

Definition at line 103 of file illusions.h.

◆ _screenText

ScreenText* Illusions::IllusionsEngine::_screenText

Definition at line 104 of file illusions.h.

◆ _scriptOpcodes

ScriptOpcodes* Illusions::IllusionsEngine::_scriptOpcodes

Definition at line 111 of file illusions.h.

◆ _scriptResource

ScriptResource* Illusions::IllusionsEngine::_scriptResource

Definition at line 119 of file illusions.h.

◆ _soundMan

SoundMan* Illusions::IllusionsEngine::_soundMan

Definition at line 114 of file illusions.h.

◆ _specialCode

SpecialCode* Illusions::IllusionsEngine::_specialCode

Definition at line 112 of file illusions.h.

◆ _stack

ScriptStack* Illusions::IllusionsEngine::_stack

Definition at line 118 of file illusions.h.

◆ _subtitleDuration

uint32 Illusions::IllusionsEngine::_subtitleDuration

Definition at line 140 of file illusions.h.

◆ _talkItems

TalkInstanceList* Illusions::IllusionsEngine::_talkItems

Definition at line 110 of file illusions.h.

◆ _threads

ThreadList* Illusions::IllusionsEngine::_threads

Definition at line 113 of file illusions.h.

◆ _unpauseControlActorFlag

bool Illusions::IllusionsEngine::_unpauseControlActorFlag

Definition at line 128 of file illusions.h.

◆ _updateFunctions

UpdateFunctions* Illusions::IllusionsEngine::_updateFunctions

Definition at line 97 of file illusions.h.

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