ScummVM API documentation
Grim::GrimEngine Class Reference
Inheritance diagram for Grim::GrimEngine:
Engine Grim::EMIEngine

Public Types

enum  EngineMode {
  PauseMode = 1, NormalMode = 2, SmushMode = 3, DrawMode = 4,
  OverworldMode = 5
}
 
enum  SpeechMode { TextOnly = 1, VoiceOnly = 2, TextAndVoice = 3 }
 
- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions, kSupportsHelp, kSupportsQuitDialogOverride
}
 

Public Member Functions

 GrimEngine (OSystem *syst, uint32 gameFlags, GrimGameType gameType, Common::Platform platform, Common::Language language)
 
void clearPools ()
 
uint32 getGameFlags ()
 
GrimGameType getGameType ()
 
Common::Language getGameLanguage ()
 
Common::Platform getGamePlatform ()
 
virtual const char * getUpdateFilename ()
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
Common::Error loadGameState (int slot) override
 
bool isRemastered () const
 
void setMode (EngineMode mode)
 
EngineMode getMode ()
 
void setPreviousMode (EngineMode mode)
 
EngineMode getPreviousMode ()
 
void setSpeechMode (SpeechMode mode)
 
SpeechMode getSpeechMode ()
 
SaveGamesavedState ()
 
bool getJustSaveLoaded ()
 
void setJustSaveLoaded (bool state)
 
void handleDebugLoadResource ()
 
void luaUpdate ()
 
void updateDisplayScene ()
 
void doFlip ()
 
void setFlipEnable (bool state)
 
bool getFlipEnable ()
 
virtual void drawTextObjects ()
 
void playIrisAnimation (Iris::Direction dir, int x, int y, int time)
 
void mainLoop ()
 
unsigned getFrameStart () const
 
unsigned getFrameTime () const
 
float getPerSecond (float rate) const
 
int getTextSpeed ()
 
void setTextSpeed (int speed)
 
void enableControl (int num)
 
void disableControl (int num)
 
float getControlAxis (int num)
 
bool getControlState (int num)
 
void clearEventQueue ()
 
SetfindSet (const Common::String &name)
 
void setSetLock (const char *name, bool lockStatus)
 
SetloadSet (const Common::String &name)
 
void setSet (const char *name)
 
void setSet (Set *scene)
 
SetgetCurrSet ()
 
void makeCurrentSetup (int num)
 
void flagRefreshShadowMask (bool flag)
 
bool getFlagRefreshShadowMask ()
 
void setSelectedActor (Actor *a)
 
ActorgetSelectedActor ()
 
virtual void invalidateActiveActorsList ()
 
virtual void invalidateTextObjectsSortOrder ()
 
const Common::List< Actor * > & getActiveActors () const
 
void addTalkingActor (Actor *actor)
 
const Common::List< Actor * > & getTalkingActors () const
 
bool areActorsTalking () const
 
void immediatelyRemoveActor (Actor *actor)
 
void drawMovieSubtitle ()
 
void setMovieSubtitle (TextObject *to)
 
void setMovieSetup ()
 
int getLanguage () const
 
void setLanguage (int langId)
 
Common::String getLanguagePrefix () const
 
bool isConceptEnabled (uint32 number) const
 
void enableConcept (uint32 number)
 
bool isCutsceneEnabled (uint32 number) const
 
void enableCutscene (uint32 number)
 
CommentarygetCommentary ()
 
Graphics::RendererType getRendererType ()
 
void setSaveMetaData (const char *, int, const char *)
 
void saveGame (const Common::String &file)
 
void loadGame (const Common::String &file)
 
void changeHardwareState ()
 
bool hasFeature (EngineFeature f) const override
 
void debugLua (const Common::String &str)
 
- Public Member Functions inherited from Engine
MetaEnginegetMetaEngine () const
 
void setMetaEngine (MetaEngine *metaEngine)
 
PauseToken pauseEngine ()
 
bool isPaused () const
 
void openMainMenuDialog ()
 
uint32 getTotalPlayTime () const
 
void setTotalPlayTime (uint32 time=0)
 
Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
Common::SaveFileManagergetSaveFileManager ()
 
bool existExtractedCDAudioFiles (uint track=1)
 
bool isDataAndCDAudioReadFromSameCD ()
 
void warnMissingExtractedCDAudio ()
 
void handleAutoSave ()
 
void saveAutosaveIfEnabled ()
 
virtual bool canSaveAutosaveCurrently ()
 
virtual int getAutosaveSlot () const
 
 Engine (OSystem *syst)
 
virtual ~Engine ()
 
virtual void initializePath (const Common::FSNode &gamePath)
 
virtual void errorString (const char *buf_input, char *buf_output, int buf_output_size)
 
virtual GUI::DebuggergetDebugger () final
 
void setDebugger (GUI::Debugger *debugger)
 
GUI::DebuggergetOrCreateDebugger ()
 
virtual void syncSoundSettings ()
 
virtual void applyGameSettings ()
 
virtual void flipMute ()
 
virtual Common::String getSaveStateName (int slot) const
 
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 
void setGameToLoadSlot (int slot)
 
virtual Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false)
 
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 
virtual bool canSaveGameStateCurrently (Common::U32String *msg=nullptr)
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 

Static Public Member Functions

static Common::Array< Common::Keymap * > initKeymapsGrim (const char *target)
 
static Common::Array< Common::Keymap * > initKeymapsEMI (const char *target)
 
- Static Public Member Functions inherited from Engine
static void quitGame ()
 
static bool shouldQuit ()
 
static MetaEngineDetectiongetMetaEngineDetection ()
 
static bool warnUserAboutUnsupportedGame (Common::String msg=Common::String())
 
static void errorUnsupportedGame (Common::String extraMsg)
 

Public Attributes

Common::StringArray _listFiles
 
Common::StringArray::const_iterator _listFilesIter
 
TextObjectDefaults _sayLineDefaults
 
TextObjectDefaults _printLineDefaults
 
TextObjectDefaults _blastTextDefaults
 
int _cursorX = 0
 
int _cursorY = 0
 
bool _isUtf8 = false
 
Font_overrideFont = nullptr
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

Common::Error run () override
 
void pauseEngineIntern (bool pause) override
 
void handleControls (Common::EventType type, const Common::KeyState &key)
 
void handleChars (Common::EventType type, const Common::KeyState &key)
 
void handleJoyAxis (byte axis, int16 position)
 
void handleMouseAxis (byte axis, int16 position)
 
void handleJoyButton (Common::EventType type, byte button)
 
void handleExit ()
 
void handlePause ()
 
void handleUserPaint ()
 
void cameraChangeHandle (int prev, int next)
 
void cameraPostChangeHandle (int num)
 
void buildActiveActorsList ()
 
void savegameCallback ()
 
GfxBasecreateRenderer (int screenW, int screenH)
 
void playAspyrLogo ()
 
virtual LuaBasecreateLua ()
 
virtual void updateNormalMode ()
 
virtual void updateDrawMode ()
 
virtual void drawNormalMode ()
 
void savegameSave ()
 
void saveGRIM ()
 
void savegameRestore ()
 
void restoreGRIM ()
 
virtual void storeSaveGameMetadata (SaveGame *state)
 
virtual void storeSaveGameImage (SaveGame *savedState)
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
void defaultSyncSoundSettings ()
 

Protected Attributes

bool _savegameLoadRequest = false
 
bool _savegameSaveRequest = false
 
Common::String _savegameFileName
 
SaveGame_savedState
 
bool _justSaveLoaded
 
Set_currSet
 
EngineMode _mode
 
EngineMode _previousMode
 
SpeechMode _speechMode
 
int _textSpeed
 
bool _flipEnable
 
char _fps [8]
 
bool _doFlip
 
bool _refreshShadowMask = false
 
bool _shortFrame = false
 
bool _setupChanged = true
 
Common::String _movieSetup
 
unsigned _frameStart = 0
 
unsigned _frameTime = 0
 
unsigned _movieTime = 0
 
int _prevSmushFrame = 0
 
unsigned int _frameCounter = 0
 
unsigned int _lastFrameTime = 0
 
unsigned _speedLimitMs
 
bool _showFps
 
bool _softRenderer
 
bool * _controlsEnabled
 
bool * _controlsState
 
float * _joyAxisPosition
 
bool _changeHardwareState = false
 
Actor_selectedActor
 
Iris_iris
 
TextObject::Ptr _movieSubtitle
 
bool _buildActiveActorsList
 
Common::List< Actor * > _activeActors
 
Common::List< Actor * > _talkingActors
 
uint32 _gameFlags
 
GrimGameType _gameType
 
Common::Platform _gamePlatform
 
Common::Language _gameLanguage
 
uint32 _pauseStartTime
 
uint32 _language
 
bool _cutsceneEnabled [kNumCutscenes]
 
bool _conceptEnabled [kNumConcepts]
 
Common::String _saveMeta1
 
int _saveMeta2 = 0
 
Common::String _saveMeta3
 
Commentary_commentary
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Static Protected Attributes

static const uint32 kNumConcepts = 98
 
static const uint32 kNumCutscenes = 40
 

Member Function Documentation

◆ run()

Common::Error Grim::GrimEngine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ canLoadGameStateCurrently()

bool Grim::GrimEngine::canLoadGameStateCurrently ( Common::U32String msg = nullptr)
inlineoverridevirtual

Indicate whether a game state can be loaded.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ loadGameState()

Common::Error Grim::GrimEngine::loadGameState ( int  slot)
overridevirtual

Load a game state.

Parameters
slotThe slot from which a save state should be loaded.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ invalidateActiveActorsList()

virtual void Grim::GrimEngine::invalidateActiveActorsList ( )
virtual

Tell the engine that an actor has been moved into/outside a set, and so that it should rebuild the list of active ones.

Reimplemented in Grim::EMIEngine.

◆ getActiveActors()

const Common::List<Actor *>& Grim::GrimEngine::getActiveActors ( ) const
inline

Return a list of the currently active actors, i. e. the actors in the current set.

◆ addTalkingActor()

void Grim::GrimEngine::addTalkingActor ( Actor actor)

Add an actor to the list of actors that are talking

◆ hasFeature()

bool Grim::GrimEngine::hasFeature ( EngineFeature  f) const
overridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ pauseEngineIntern()

void Grim::GrimEngine::pauseEngineIntern ( bool  pause)
overrideprotectedvirtual

Actual implementation of pauseEngine by subclasses.

See also
Engine::pauseEngine

Reimplemented from Engine.


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