ScummVM API documentation
Sword2::Sword2Engine Class Reference
Inheritance diagram for Sword2::Sword2Engine:
Engine

Public Member Functions

 Sword2Engine (OSystem *syst, const ADGameDescription *gameDesc)
 
int getFramesPerSecond ()
 
void registerDefaultSettings ()
 
void readSettings ()
 
void writeSettings ()
 
void setupPersistentResources ()
 
bool getSubtitles ()
 
void setSubtitles (bool b)
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
Common::Error loadGameState (int slot) override
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
uint32 setInputEventFilter (uint32 filter)
 
void parseInputEvents ()
 
bool checkForMouseEvents ()
 
MouseEventmouseEvent ()
 
KeyboardEventkeyboardEvent ()
 
void fetchPalette (byte *screenFile, byte *palBuffer)
 
byte * fetchScreenHeader (byte *screenFile)
 
byte * fetchLayerHeader (byte *screenFile, uint16 layerNo)
 
byte * fetchShadingMask (byte *screenFile)
 
byte * fetchAnimHeader (byte *animFile)
 
byte * fetchCdtEntry (byte *animFile, uint16 frameNo)
 
byte * fetchFrameHeader (byte *animFile, uint16 frameNo)
 
byte * fetchBackgroundParallaxLayer (byte *screenFile, int layer)
 
byte * fetchBackgroundLayer (byte *screenFile)
 
byte * fetchForegroundParallaxLayer (byte *screenFile, int layer)
 
byte * fetchTextLine (byte *file, uint32 text_line)
 
bool checkTextLine (byte *file, uint32 text_line)
 
byte * fetchPaletteMatchTable (byte *screenFile)
 
uint32 saveGame (uint16 slotNo, const byte *description)
 
uint32 restoreGame (uint16 slotNo)
 
uint32 getSaveDescription (uint16 slotNo, byte *description)
 
bool saveExists ()
 
bool saveExists (uint16 slotNo)
 
uint32 restoreFromBuffer (byte *buffer, uint32 size)
 
Common::String getSaveStateName (int slot) const override
 
uint32 findBufferSize ()
 
void startGame ()
 
void gameCycle ()
 
void restartGame ()
 
void sleepUntil (uint32 time)
 
void initializeFontResourceFlags ()
 
void initializeFontResourceFlags (uint8 language)
 
bool initStartMenu ()
 
void registerStartPoint (int32 key, char *name)
 
uint32 getNumStarts ()
 
uint32 getNumScreenManagers ()
 
StartUpgetStartList ()
 
void runStart (int start)
 
uint32 getMillis ()
 
- 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 ()
 
bool enhancementEnabled (int32 cls)
 
virtual void applyGameSettings ()
 
virtual void flipMute ()
 
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 ()
 

Static Public Member Functions

static bool isPsx ()
 
- 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)
 

Public Attributes

uint32 _features
 
MemoryManager_memory
 
ResourceManager_resman
 
Sound_sound
 
Screen_screen
 
Mouse_mouse
 
Logic_logic
 
FontRenderer_fontRenderer
 
bool _isRTL
 
Debugger_debugger
 
Common::RandomSource _rnd
 
uint32 _speechFontId
 
uint32 _controlsFontId
 
uint32 _redFontId
 
bool _wantSfxDebug
 
int32 _gameCycle
 
bool _isKorTrs
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

Common::Error run () override
 
bool hasFeature (EngineFeature f) const override
 
void syncSoundSettings () override
 
void pauseEngineIntern (bool pause) override
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
void defaultSyncSoundSettings ()
 

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions, kSupportsHelp, kSupportsQuitDialogOverride
}
 
- 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 Sword2::Sword2Engine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ hasFeature()

bool Sword2::Sword2Engine::hasFeature ( EngineFeature  f) const
overrideprotectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ syncSoundSettings()

void Sword2::Sword2Engine::syncSoundSettings ( )
overrideprotectedvirtual

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.

◆ pauseEngineIntern()

void Sword2::Sword2Engine::pauseEngineIntern ( bool  pause)
overrideprotectedvirtual

Actual implementation of pauseEngine by subclasses.

See also
Engine::pauseEngine

Reimplemented from Engine.

◆ saveGameState()

Common::Error Sword2::Sword2Engine::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.

◆ canSaveGameStateCurrently()

bool Sword2::Sword2Engine::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.

◆ loadGameState()

Common::Error Sword2::Sword2Engine::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.

◆ canLoadGameStateCurrently()

bool Sword2::Sword2Engine::canLoadGameStateCurrently ( Common::U32String msg = nullptr)
overridevirtual

Indicate whether a game state can be loaded.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ getSaveStateName()

Common::String Sword2::Sword2Engine::getSaveStateName ( int  slot) const
overridevirtual

Generate the savegame filename.

Reimplemented from Engine.


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