ScummVM API documentation
Agi::AgiEngine Class Reference
Inheritance diagram for Agi::AgiEngine:
Agi::AgiBase Engine

Public Member Functions

 AgiEngine (OSystem *syst, const AGIGameDescription *gameDesc)
 
bool promptIsEnabled () override
 
Common::Error loadGameState (int slot) override
 
Common::Error saveGameState (int slot, const Common::String &description, bool isAutosave=false) override
 
SavedGameSlotIdArray getSavegameSlotIds ()
 
bool getSavegameInformation (int16 slotId, Common::String &saveDescription, uint32 &saveDate, uint32 &saveTime, bool &saveIsValid)
 
int saveGame (const Common::String &fileName, const Common::String &descriptionString)
 
int loadGame (const Common::String &fileName, bool checkId=true)
 
bool saveGameDialog ()
 
bool saveGameAutomatic ()
 
bool loadGameDialog ()
 
bool loadGameAutomatic ()
 
int doSave (int slot, const Common::String &desc)
 
int doLoad (int slot, bool showMessages)
 
int scummVMSaveLoadDialog (bool isSave)
 
void clearImageStack () override
 
void recordImageStackCall (uint8 type, int16 p1, int16 p2, int16 p3, int16 p4, int16 p5, int16 p6, int16 p7) override
 
void replayImageStackCall (uint8 type, int16 p1, int16 p2, int16 p3, int16 p4, int16 p5, int16 p6, int16 p7) override
 
void releaseImageStack () override
 
void wait (uint32 msec, bool busy=false)
 
int agiInit ()
 
void agiDeinit ()
 
int loadResource (int16 resourceType, int16 resourceNr)
 
void unloadResource (int16 resourceType, int16 resourceNr)
 
void unloadResources ()
 
int getKeypress () override
 
bool isKeypress () override
 
void clearKeyQueue () override
 
byte getVar (int16 varNr)
 
void setVar (int16 varNr, byte newValue)
 
void syncSoundSettings () override
 
void decrypt (uint8 *mem, int len)
 
uint16 processAGIEvents ()
 
int runGame ()
 
void newRoom (int16 newRoomNr)
 
void resetControllers ()
 
void interpretCycle ()
 
void playGame ()
 
void allowSynthetic (bool)
 
void processScummVMEvents ()
 
void checkQuickLoad ()
 
const Common::String getTargetName () const
 
int loadObjects (const char *fname)
 
int loadObjects (Common::SeekableReadStream &fp, int flen)
 
const char * objectName (uint16 objectNr)
 
int objectGetLocation (uint16 objectNr)
 
void objectSetLocation (uint16 objectNr, int location)
 
int decodeLogic (int16 logicNr)
 
void unloadLogic (int16 logicNr)
 
int runLogic (int16 logicNr)
 
void debugConsole (int lognum, int mode, const char *str)
 
bool testIfCode (int16 logicNr)
 
void executeAgiCommand (uint8 op, uint8 *p)
 
void skipInstruction (byte op)
 
void skipInstructionsUntil (byte v)
 
bool testObjRight (uint8 n, uint8 x1, uint8 y1, uint8 x2, uint8 y2)
 
bool testObjCenter (uint8 n, uint8 x1, uint8 y1, uint8 x2, uint8 y2)
 
bool testObjInBox (uint8 n, uint8 x1, uint8 y1, uint8 x2, uint8 y2)
 
bool testPosn (uint8 n, uint8 x1, uint8 y1, uint8 x2, uint8 y2)
 
bool testSaid (uint8 nwords, uint8 *cc)
 
bool testController (uint8 cont)
 
bool testCompareStrings (uint8 s1, uint8 s2)
 
void setView (ScreenObjEntry *screenObj, int16 viewNr)
 
void setLoop (ScreenObjEntry *screenObj, int16 loopNr)
 
void setCel (ScreenObjEntry *screenObj, int16 celNr)
 
void clipViewCoordinates (ScreenObjEntry *screenObj)
 
void startUpdate (ScreenObjEntry *viewPtr)
 
void stopUpdate (ScreenObjEntry *viewPtr)
 
void updateScreenObjTable ()
 
void unloadView (int16 viewNr)
 
int decodeView (byte *resourceData, uint16 resourceSize, int16 viewNr)
 
bool isEgoView (const ScreenObjEntry *screenObj)
 
void motionActivated (ScreenObjEntry *screenObj)
 
void cyclerActivated (ScreenObjEntry *screenObj)
 
void checkAllMotions ()
 
void moveObj (ScreenObjEntry *screenObj)
 
void inDestination (ScreenObjEntry *screenObj)
 
void fixPosition (int16 screenObjNr)
 
void fixPosition (ScreenObjEntry *screenObj)
 
void updatePosition ()
 
int getDirection (int16 objX, int16 objY, int16 destX, int16 destY, int16 stepSize)
 
int doPollKeyboard ()
 
bool handleMouseClicks (uint16 &key)
 
bool handleController (uint16 key)
 
bool showPredictiveDialog ()
 
int waitKey ()
 
int waitAnyKey ()
 
void waitAnyKeyOrFinishedSound ()
 
void nonBlockingText_IsShown ()
 
void nonBlockingText_Forget ()
 
void artificialDelay_Reset ()
 
void artificialDelay_CycleDone ()
 
uint16 artificialDelay_SearchTable (AgiArtificialDelayTriggerType triggerType, int16 orgNr, int16 newNr)
 
void artificialDelayTrigger_NewRoom (int16 newRoomNr)
 
void artificialDelayTrigger_DrawPicture (int16 newPictureNr)
 
void redrawScreen ()
 
void inGameTimerReset (uint32 newPlayTime=0)
 
void inGameTimerResetPassedCycles ()
 
uint32 inGameTimerGet ()
 
uint32 inGameTimerGetPassedCycles ()
 
void inGameTimerUpdate ()
 
const AgiOpCodeEntrygetOpCodesTable ()
 
- Public Member Functions inherited from Agi::AgiBase
 AgiBase (OSystem *syst, const AGIGameDescription *gameDesc)
 
bool getFlag (int16 flagNr)
 
void setFlag (int16 flagNr, bool newState)
 
void flipFlag (int16 flagNr)
 
void setFlagOrVar (int16 flagNr, bool newState)
 
uint32 getGameID () const
 
uint32 getFeatures () const
 
uint16 getVersion () const
 
uint16 getGameType () const
 
Common::Language getLanguage () const
 
bool isLanguageRTL () const
 
Common::Platform getPlatform () const
 
const char * getGameMD5 () const
 
void initFeatures ()
 
void initVersion ()
 
const char * getDiskName (uint16 id)
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
const byte * getFontData ()
 
void cycleInnerLoopActive (int16 loopType)
 
void cycleInnerLoopInactive ()
 
bool cycleInnerLoopIsActive ()
 
- 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::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

Common::Array< AgiObject_objects
 
uint8 * _intobj
 
bool _restartGame
 
SpritesMgr_sprites
 
TextMgr_text
 
InventoryMgr_inventory
 
PictureMgr_picture
 
AgiLoader_loader
 
GfxMenu_menu
 
SystemUI_systemUI
 
Common::DumpFile_logFile
 
Common::Stack< ImageStackElement_imageStack
 
bool _keyHoldMode
 
Common::KeyCode _keyHoldModeLastKey
 
- Public Attributes inherited from Agi::AgiBase
Words_words
 
GfxFont_font
 
GfxMgr_gfx
 
Common::RenderMode _renderMode
 
AgiDebug _debug
 
AgiGame _game
 
Common::RandomSource_rnd
 
SoundMgr_sound
 
Mouse _mouse
 
bool _noSaveLoadAllowed
 
int _soundemu
 
const AGIGameDescription_gameDescription
 
uint32 _gameFeatures
 
uint16 _gameVersion
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

Common::Error go () override
 
void initialize () override
 
- Protected Member Functions inherited from Agi::AgiBase
Common::Error init ()
 
Common::Error run () override
 
bool hasFeature (EngineFeature f) const override
 
void initRenderMode ()
 
- 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 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

◆ loadGameState()

Common::Error Agi::AgiEngine::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 Agi::AgiEngine::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.

◆ unloadResources()

void Agi::AgiEngine::unloadResources ( )

Unload all resources except Logic 0

◆ syncSoundSettings()

void Agi::AgiEngine::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: