ScummVM API documentation
Sci::SciEngine Class Reference
Inheritance diagram for Sci::SciEngine:
Engine

Public Member Functions

 SciEngine (OSystem *syst, const ADGameDescription *desc, SciGameId gameId)
 
Common::Error run () override
 
bool hasFeature (EngineFeature f) const override
 
void pauseEngineIntern (bool pause) override
 
void severeError ()
 
ConsolegetSciDebugger ()
 
Common::Error loadGameState (int slot) override
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
void syncSoundSettings () override
 from ScummVM to the game
 
void updateSoundMixerVolumes ()
 
uint32 getTickCount ()
 
void setTickCount (const uint32 ticks)
 
void errorString (const char *buf1, char *buf2, int size) override
 
int getAutosaveSlot () const override
 
const SciGameId & getGameId () const
 
const char * getGameIdStr () const
 
Common::Language getLanguage () const
 
bool isLanguageRTL () const
 
Common::Platform getPlatform () const
 
bool isDemo () const
 
bool isCD () const
 
bool useHiresGraphics () const
 
bool isBE () const
 
bool hasParser () const
 
bool hasMacFonts () const
 
bool hasMacIconBar () const
 
bool hasMacSaveRestoreDialogs () const
 
ResourceManagergetResMan () const
 
ScriptPatchergetScriptPatcher () const
 
KernelgetKernel () const
 
EngineStategetEngineState () const
 
VocabularygetVocabulary () const
 
EventManagergetEventManager () const
 
reg_t getGameObject () const
 
Common::RandomSourcegetRNG ()
 
Common::String getSavegameName (int nr) const
 
Common::String getSavegamePattern () const
 
Common::String getFilePrefix () const
 
Common::String wrapFilename (const Common::String &name) const
 
Common::String unwrapFilename (const Common::String &name) const
 
const char * getGameObjectName ()
 
int inQfGImportRoom () const
 
void showQfgImportMessageBox () const
 
void sleep (uint32 msecs)
 
void scriptDebug ()
 
bool checkExportBreakpoint (uint16 script, uint16 pubfunct)
 
bool checkSelectorBreakpoint (BreakpointType breakpointType, reg_t send_obj, int selector)
 
bool checkAddressBreakpoint (const reg_t &address)
 
bool checkKernelBreakpoint (const Common::String &name)
 
Common::String strSplitLanguage (const char *str, uint16 *splitLanguage, const char *sep="\---------\)
 
Common::String strSplit (const char *str, const char *sep="\---------\)
 
kLanguage getSciLanguage ()
 
void setSciLanguage (kLanguage lang)
 
void setSciLanguage ()
 
Common::String getSciLanguageString (const Common::String &str, kLanguage requestedLanguage, kLanguage *secondaryLanguage=nullptr, uint16 *languageSplitter=nullptr) const
 
void checkVocabularySwitch ()
 
void initGraphics ()
 
void suggestDownloadGK2SubTitlesPatch ()
 
Common::MacResManagergetMacExecutable ()
 
- 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 ()
 
 Engine (OSystem *syst)
 
virtual ~Engine ()
 
virtual void initializePath (const Common::FSNode &gamePath)
 
virtual GUI::DebuggergetDebugger () final
 
void setDebugger (GUI::Debugger *debugger)
 
GUI::DebuggergetOrCreateDebugger ()
 
bool enhancementEnabled (int32 cls)
 
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

GfxAnimate_gfxAnimate
 
GfxCache_gfxCache
 
GfxCompare_gfxCompare
 
GfxControls16_gfxControls16
 
GfxCoordAdjuster16_gfxCoordAdjuster
 
GfxCursor_gfxCursor
 
GfxMenu_gfxMenu
 
GfxPalette_gfxPalette16
 
GfxRemap_gfxRemap16
 
GfxPaint16_gfxPaint16
 
GfxPorts_gfxPorts
 
GfxScreen_gfxScreen
 
GfxText16_gfxText16
 
GfxTransitions_gfxTransitions
 
GfxMacIconBar_gfxMacIconBar
 
GfxMacFontManager_gfxMacFontManager
 
SciTTS_tts
 
AudioPlayer_audio
 
Sync_sync
 
SoundCommandParser_soundCmd
 
GameFeatures_features
 
GuestAdditions_guestAdditions
 
opcode_format(* _opcode_formats )[4]
 
DebugState _debugState
 
uint32 _speedThrottleDelay
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

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 Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
void defaultSyncSoundSettings ()
 
- 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 Sci::SciEngine::run ( )
overridevirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ hasFeature()

bool Sci::SciEngine::hasFeature ( EngineFeature  f) const
overridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ pauseEngineIntern()

void Sci::SciEngine::pauseEngineIntern ( bool  pause)
overridevirtual

Actual implementation of pauseEngine by subclasses.

See also
Engine::pauseEngine

Reimplemented from Engine.

◆ loadGameState()

Common::Error Sci::SciEngine::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.

◆ saveGameState()

Common::Error Sci::SciEngine::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.

◆ canLoadGameStateCurrently()

bool Sci::SciEngine::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.

◆ canSaveGameStateCurrently()

bool Sci::SciEngine::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.

◆ errorString()

void Sci::SciEngine::errorString ( const char *  buf_input,
char *  buf_output,
int  buf_output_size 
)
overridevirtual

Prepare an error string that is printed by the error() function.

Reimplemented from Engine.

◆ getAutosaveSlot()

int Sci::SciEngine::getAutosaveSlot ( ) const
inlineoverridevirtual

Disable support for ScummVM autosaves.

A lot of SCI games already have an autosaving mechanism. Also, a lot of games have death screens when the player does something wrong, and autosaves could kick in when the death screen is shown, which makes them useless, since the player can only restore or restart.

Another place where autosaves could kick in is during screens with internal loops, e.g. the inventory screen, where the autosave created would be invalid, as the internal loop isn't persisted in saved games.

For now, we allow saving in places where the user has control via GuestAdditions::userHasControl(), but as mentioned above, these do not cover cases where the user does have control, but saving would either be useless (e.g. in death screens) or invalid saved would be created (e.g. while the inventory screen is open).

In the future, if we are able to detect all death screens, all internal loops and generally all places where saving shouldn't be allowed, we could re-enable this feature.

Reimplemented from Engine.

◆ isLanguageRTL()

bool Sci::SciEngine::isLanguageRTL ( ) const

Returns true if the game's language direction is Right To Left. RTL support did not exist in the original SCI engine. This is a ScummVM feature to support modern fan translations.

◆ getPlatform()

Common::Platform Sci::SciEngine::getPlatform ( ) const

Returns the original platform of the game.

◆ isBE()

bool Sci::SciEngine::isBE ( ) const

Returns true if the game's original platform is Macintosh or Amiga. Note that this is not necessarily the endianness of the game's resources.

◆ hasMacFonts()

bool Sci::SciEngine::hasMacFonts ( ) const

Returns true if the game supports native Mac fonts and the fonts are available.

◆ hasMacIconBar()

bool Sci::SciEngine::hasMacIconBar ( ) const

Returns true if the game is a Mac version with an icon bar on the bottom.

◆ hasMacSaveRestoreDialogs()

bool Sci::SciEngine::hasMacSaveRestoreDialogs ( ) const

Returns true if the game is a Mac version that used native Mac file dialogs for saving and restoring. These versions do not include resources for the normal save and restore screens, so the ScummVM UI must always be used.

◆ getFilePrefix()

Common::String Sci::SciEngine::getFilePrefix ( ) const

Returns 'TARGET-' prefix for filenames in the save directory.

◆ wrapFilename()

Common::String Sci::SciEngine::wrapFilename ( const Common::String name) const

Prepend 'TARGET-' to the given filename.

◆ unwrapFilename()

Common::String Sci::SciEngine::unwrapFilename ( const Common::String name) const

Remove the 'TARGET-' prefix of the given filename, if present.

◆ getGameObjectName()

const char* Sci::SciEngine::getGameObjectName ( )

Returns the name of the game object. Currently used for identifying specific fan made games.

◆ inQfGImportRoom()

int Sci::SciEngine::inQfGImportRoom ( ) const

Tests if we are in a QfG import screen, where special handling of file-listings is performed.

Returns
2 if in QFG2 import, 3 if in QFG3 import, 4 if in QFG4 import, else 0.

◆ showQfgImportMessageBox()

void Sci::SciEngine::showQfgImportMessageBox ( ) const

Shows a ScummVM message box explaining how to import Qfg saved character files.

◆ sleep()

void Sci::SciEngine::sleep ( uint32  msecs)

Sleep for the given number of milliseconds, while polling for input to keep the screen updated and responsive.

◆ strSplitLanguage()

Common::String Sci::SciEngine::strSplitLanguage ( const char *  str,
uint16 *  splitLanguage 
)

Processes a multilanguage string based on the current language settings and returns a string that is ready to be displayed.

Parameters
strThe multilanguage string.
splitLanguageThe two-character language delimiter detected by strSplitLanguage. If a delimiter is found, then it is written to this address as a 16-bit integer. For example: j becomes 0x6A25.
sepOptional separator to place between the main language and subtitle language. If nullptr is passed then no subtitle will be added to the returned string.
Returns
The processed string.

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