ScummVM API documentation
Twp::TwpEngine Class Reference
Inheritance diagram for Twp::TwpEngine:
Engine

Classes

struct  Cursor
 
struct  Stats
 

Public Member Functions

 TwpEngine (OSystem *syst, const TwpGameDescription *gameDesc)
 
uint32 getFeatures () const
 
Common::String getGameId () const
 
Common::RandomSourcegetRandomSource ()
 
HSQUIRRELVM getVm ()
 
GfxgetGfx ()
 
TextDbgetTextDb ()
 
bool hasFeature (EngineFeature f) const override
 
void updateSettingVars ()
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false) override
 
Common::Error loadGameState (int slot) override
 
Common::Error loadGameStream (Common::SeekableReadStream *stream) override
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 
bool canSaveAutosaveCurrently () override
 
void capture (Graphics::Surface &surface, int width, int height)
 
Math::Vector2d winToScreen (const Math::Vector2d &pos) const
 
Math::Vector2d screenToWin (const Math::Vector2d &pos) const
 
Math::Vector2d roomToScreen (const Math::Vector2d &pos) const
 
Math::Vector2d screenToRoom (const Math::Vector2d &pos) const
 
void setActor (Common::SharedPtr< Object > actor, bool userSelected=false)
 
Common::SharedPtr< ObjectobjAt (const Math::Vector2d &pos)
 
void flashSelectableActor (int flash)
 
void sayLineAt (const Math::Vector2d &pos, const Color &color, Common::SharedPtr< Object > actor, float duration, const Common::String &text)
 
void stopTalking ()
 
bool isSomeoneTalking () const
 
void walkFast (bool state=true)
 
void actorEnter (Common::SharedPtr< Object > actor)
 
void actorExit (Common::SharedPtr< Object > actor)
 
Common::SharedPtr< RoomdefineRoom (const Common::String &name, HSQOBJECT table, bool pseudo=false)
 
void setRoom (Common::SharedPtr< Room > room, bool force=false)
 
void enterRoom (Common::SharedPtr< Room > room, Common::SharedPtr< Object > door=nullptr)
 
void cameraAt (const Math::Vector2d &at)
 
Math::Vector2d cameraPos ()
 
void follow (Common::SharedPtr< Object > actor)
 
void fadeTo (FadeEffect effect, float duration, bool fadeToSep=false)
 
void execNutEntry (HSQUIRRELVM v, const Common::String &entry)
 
void execBnutEntry (HSQUIRRELVM v, const Common::String &entry)
 
bool callVerb (Common::SharedPtr< Object > actor, VerbId verbId, Common::SharedPtr< Object > noun1, Common::SharedPtr< Object > noun2=nullptr)
 
bool execSentence (Common::SharedPtr< Object > actor, VerbId verbId, Common::SharedPtr< Object > noun1, Common::SharedPtr< Object > noun2=nullptr)
 
float getRandom () const
 
float getRandom (float min, float max) const
 
int runDialog (GUI::Dialog &dialog) override
 
SQRESULT skipCutscene ()
 
- 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 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 ()
 
bool enhancementEnabled (int32 cls)
 
virtual void syncSoundSettings ()
 
virtual void applyGameSettings ()
 
virtual void flipMute ()
 
virtual Common::String getSaveStateName (int slot) const
 
void setGameToLoadSlot (int slot)
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 

Public Attributes

unique_ptr< GGPackSet_pack
 
unique_ptr< ResManager_resManager
 
Common::Array< Common::SharedPtr< Room > > _rooms
 
Common::Array< Common::SharedPtr< Object > > _actors
 
Common::Array< Common::SharedPtr< Thread > > _threads
 
Common::Array< Common::SharedPtr< Task > > _tasks
 
Common::Array< Common::SharedPtr< Callback > > _callbacks
 
Common::SharedPtr< Object_actor
 
Common::SharedPtr< Object_followActor
 
Common::SharedPtr< Room_room
 
float _time = 0.f
 
Common::SharedPtr< Object_noun1
 
Common::SharedPtr< Object_noun2
 
UseFlag _useFlag
 
HSQOBJECT _defaultObj
 
bool _walkFastState = false
 
bool _holdToMove = false
 
float _nextHoldToMoveTime = 0.f
 
int _frameCounter = 0
 
Common::SharedPtr< Lighting_lighting
 
struct {
   int   id = 0
 
   InputStateFlag   inputState = (InputStateFlag)0
 
   bool   showCursor = false
 
   bool   inOverride = false
 
   HSQOBJECT   envObj
 
   HSQOBJECT   closureOverride
 
_cutscene
 
unique_ptr< Scene_scene
 
unique_ptr< Scene_screenScene
 
unique_ptr< NoOverrideNode_noOverride
 
InputState _inputState
 
unique_ptr< Camera_camera
 
unique_ptr< TextDb_textDb
 
unique_ptr< Dialog_dialog
 
struct Twp::TwpEngine::Cursor _cursor
 
struct Twp::TwpEngine::Stats _stats
 
unique_ptr< Hud_hud
 
Inventory _uiInv
 
ActorSwitcher _actorSwitcher
 
unique_ptr< AudioSystem_audio
 
unique_ptr< SaveGameManager_saveGameManager
 
unique_ptr< ShaderParams_shaderParams
 
unique_ptr< HotspotMarkerNode_hotspotMarker
 
unique_ptr< FadeShader_fadeShader
 
unique_ptr< LightingNode_lightingNode
 
unique_ptr< Motor_moveCursorTo
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

Common::Error run () override
 
- Protected Member Functions inherited from Engine
void defaultSyncSoundSettings ()
 
virtual void pauseEngineIntern (bool pause)
 

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions, kSupportsHelp, kSupportsQuitDialogOverride
}
 
- Static Public Member Functions inherited from Engine
static void quitGame ()
 
static bool shouldQuit ()
 
static bool warnUserAboutUnsupportedGame (Common::String msg=Common::String())
 
static void errorUnsupportedGame (Common::String extraMsg)
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 
int32 _activeEnhancements = kEnhGameBreakingBugFixes
 

Member Function Documentation

◆ run()

Common::Error Twp::TwpEngine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ getGameId()

Common::String Twp::TwpEngine::getGameId ( ) const

Returns the game Id

◆ getRandomSource()

Common::RandomSource& Twp::TwpEngine::getRandomSource ( )
inline

Gets the random source

◆ hasFeature()

bool Twp::TwpEngine::hasFeature ( EngineFeature  f) const
inlineoverridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ canLoadGameStateCurrently()

bool Twp::TwpEngine::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.

◆ canSaveGameStateCurrently()

bool Twp::TwpEngine::canSaveGameStateCurrently ( Common::U32String msg = nullptr)
overridevirtual

Indicate whether a game state can be saved.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ saveGameStream()

Common::Error Twp::TwpEngine::saveGameStream ( Common::WriteStream stream,
bool  isAutosave = false 
)
overridevirtual

Save a game state.

Parameters
streamThe write stream to save the savegame data to.
isAutosaveExpected to be true if an autosave is being created.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ loadGameState()

Common::Error Twp::TwpEngine::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.

◆ loadGameStream()

Common::Error Twp::TwpEngine::loadGameStream ( Common::SeekableReadStream stream)
overridevirtual

Load a game state.

Parameters
streamThe stream to load the save state from.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ saveGameState()

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

Save a game state.

Parameters
slotThe slot into which the save state should be stored.
descDescription for the save state, entered by the user.
isAutosaveExpected to be true if an autosave is being created.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ canSaveAutosaveCurrently()

bool Twp::TwpEngine::canSaveAutosaveCurrently ( )
inlineoverridevirtual

Indicate whether an autosave can currently be done.

Reimplemented from Engine.

◆ runDialog()

int Twp::TwpEngine::runDialog ( GUI::Dialog dialog)
overridevirtual

Run a GUI dialog.

Reimplemented from Engine.


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