ScummVM API documentation
Crab::CrabEngine Class Reference
Inheritance diagram for Crab::CrabEngine:
Engine

Public Member Functions

 CrabEngine (OSystem *syst, const ADGameDescription *gameDesc)
 
void initializePath (const Common::FSNode &gamePath) override
 
uint32 getFeatures () const
 
Common::String getGameId () const
 
uint32 getRandomNumber (uint maxNum)
 
bool hasFeature (EngineFeature f) const override
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
Common::Error syncGame (Common::Serializer &s)
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave) override
 
Common::Error loadGameState (int slot) override
 
void syncSoundSettings () override
 
- 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 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 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 saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 

Public Attributes

Graphics::Screen_screen = nullptr
 
Graphics::PixelFormat_format = nullptr
 
pyrodactyl::image::ImageManager_imageManager = nullptr
 
pyrodactyl::text::TextManager_textManager = nullptr
 
pyrodactyl::input::InputManager_inputManager = nullptr
 
pyrodactyl::music::MusicManager_musicManager = nullptr
 
pyrodactyl::input::Cursor_mouse = nullptr
 
pyrodactyl::event::GameEventStore_eventStore = nullptr
 
LoadingScreen_loadingScreen = nullptr
 
pyrodactyl::ui::SlideShow_helpScreen = nullptr
 
pyrodactyl::ui::OptionMenu_optionMenu = nullptr
 
pyrodactyl::ui::FileMenu< pyrodactyl::ui::SaveFileData > * _loadMenu = nullptr
 
FilePaths_filePath = nullptr
 
TempValue_tempData = nullptr
 
StringPool_stringPool = nullptr
 
ScreenSettings_screenSettings = nullptr
 
Graphics::ManagedSurface_thumbnail
 
uint32 _debugDraw
 
Common::FSNode _gameDataDir
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

Common::Error run () override
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
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 MetaEngineDetectiongetMetaEngineDetection ()
 
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
 

Member Function Documentation

◆ run()

Common::Error Crab::CrabEngine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ initializePath()

void Crab::CrabEngine::initializePath ( const Common::FSNode gamePath)
overridevirtual

Initialize SearchMan according to the game path.

By default, this adds the directory in non-flat mode with a depth of 4 as priority 0 to SearchMan.

Parameters
gamePathThe base directory of the game data.

Reimplemented from Engine.

◆ getGameId()

Common::String Crab::CrabEngine::getGameId ( ) const

Returns the game Id

◆ getRandomNumber()

uint32 Crab::CrabEngine::getRandomNumber ( uint  maxNum)
inline

Gets a random number

◆ hasFeature()

bool Crab::CrabEngine::hasFeature ( EngineFeature  f) const
inlineoverridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ canLoadGameStateCurrently()

bool Crab::CrabEngine::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 Crab::CrabEngine::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.

◆ syncGame()

Common::Error Crab::CrabEngine::syncGame ( Common::Serializer s)

Uses a serializer to allow implementing savegame loading and saving using a single method

◆ saveGameState()

Common::Error Crab::CrabEngine::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave 
)
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.

◆ loadGameState()

Common::Error Crab::CrabEngine::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.

◆ syncSoundSettings()

void Crab::CrabEngine::syncSoundSettings ( )
overridevirtual

Notify the engine that the sound settings in the config manager might have changed and that it should adjust any internal volume (and other) 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.

Reimplemented from Engine.


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