ScummVM
Agi::AgiEngine Class Reference

#include <agi.h>

Inheritance diagram for Agi::AgiEngine:
Collaboration diagram for Agi::AgiEngine:

Public Member Functions

 AgiEngine (OSystem *syst, const AGIGameDescription *gameDesc)
 
virtual ~AgiEngine ()
 
bool promptIsEnabled ()
 
Common::Error loadGameState (int slot)
 Load a game state. More...
 
Common::Error saveGameState (int slot, const Common::String &description)
 Save a game state. More...
 
SavedGameSlotIdArray getSavegameSlotIds ()
 
Common::String getSavegameFilename (int16 slotId) const
 
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 ()
 
void recordImageStackCall (uint8 type, int16 p1, int16 p2, int16 p3, int16 p4, int16 p5, int16 p6, int16 p7)
 
void replayImageStackCall (uint8 type, int16 p1, int16 p2, int16 p3, int16 p4, int16 p5, int16 p6, int16 p7)
 
void releaseImageStack ()
 
void wait (uint32 msec, bool busy=false)
 
GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
 
int agiInit ()
 
int agiDeinit ()
 
int agiDetectGame ()
 
int agiLoadResource (int16 resourceType, int16 resourceNr)
 
int agiUnloadResource (int16 resourceType, int16 resourceNr)
 
void agiUnloadResources ()
 
virtual int getKeypress ()
 
virtual bool isKeypress ()
 
virtual void clearKeyQueue ()
 
byte getVar (int16 varNr)
 
void setVar (int16 varNr, byte newValue)
 
void syncSoundSettings ()
 Notify the engine that the sound settings in the config manager may have changed and that it hence should adjust any internal volume etc. More...
 
void decrypt (uint8 *mem, int len)
 
void releaseSprites ()
 
uint16 processAGIEvents ()
 
int viewPictures ()
 
int runGame ()
 
int getAppDir (char *appDir, unsigned int size)
 
int setupV2Game (int ver)
 
int setupV3Game (int ver)
 
void newRoom (int16 newRoomNr)
 Set up new room. More...
 
void resetControllers ()
 
void interpretCycle ()
 
int playGame ()
 
void allowSynthetic (bool)
 
void processScummVMEvents ()
 
void checkQuickLoad ()
 
int showObjects ()
 
int loadObjects (const char *fname)
 
int loadObjects (Common::File &fp)
 Loads an object file that is in the common VOL resource format. More...
 
const char * objectName (uint16 objectNr)
 
int objectGetLocation (uint16 objectNr)
 
void objectSetLocation (uint16 objectNr, int)
 
int decodeLogic (int16 logicNr)
 Decode logic resource This function decodes messages from the specified raw logic resource into a message list. More...
 
void unloadLogic (int16 logicNr)
 Unload logic resource This function unloads the specified logic resource, freeing any memory chunks allocated for this resource. More...
 
int runLogic (int16 logicNr)
 Execute a logic script. More...
 
void debugConsole (int, int, const char *)
 
bool testIfCode (int16 logicNr)
 
void executeAgiCommand (uint8, uint8 *)
 
void skipInstruction (byte op)
 
void skipInstructionsUntil (byte v)
 
uint8 testObjRight (uint8, uint8, uint8, uint8, uint8)
 
uint8 testObjCenter (uint8, uint8, uint8, uint8, uint8)
 
uint8 testObjInBox (uint8, uint8, uint8, uint8, uint8)
 
uint8 testPosn (uint8, uint8, uint8, uint8, uint8)
 
uint8 testSaid (uint8, uint8 *)
 
uint8 testController (uint8)
 
uint8 testCompareStrings (uint8, uint8)
 
void setView (ScreenObjEntry *screenObj, int16 viewNr)
 Set a view table entry to use the specified view resource. More...
 
void setLoop (ScreenObjEntry *screenObj, int16 loopNr)
 Set a view table entry to use the specified loop of the current view. More...
 
void setCel (ScreenObjEntry *screenObj, int16 celNr)
 Set a view table entry to use the specified cel of the current loop. More...
 
void clipViewCoordinates (ScreenObjEntry *screenObj)
 Restrict view table entry's position so it stays wholly inside the screen. More...
 
void startUpdate (ScreenObjEntry *)
 Set the view table entry as updating. More...
 
void stopUpdate (ScreenObjEntry *)
 Set the view table entry as non-updating. More...
 
void updateScreenObjTable ()
 Update view table entries. More...
 
void unloadView (int16 viewNr)
 Unloads all data in a view resource. More...
 
int decodeView (byte *resourceData, uint16 resourceSize, int16 viewNr)
 Decode an AGI view resource. More...
 
void addToPic (int, int, int, int, int, int, int)
 
void drawObj (int)
 
bool isEgoView (const ScreenObjEntry *screenObj)
 
void motionActivated (ScreenObjEntry *screenObj)
 
void cyclerActivated (ScreenObjEntry *screenObj)
 
void checkAllMotions ()
 
void moveObj (ScreenObjEntry *screenObj)
 Wrapper for static function motion_moveobj(). More...
 
void inDestination (ScreenObjEntry *screenObj)
 Check if given entry is at destination point. More...
 
void fixPosition (int16 screenObjNr)
 Adjust position of a sprite This function adjusts the position of a sprite moving it until certain criteria is matched. More...
 
void fixPosition (ScreenObjEntry *screenObj)
 
void updatePosition ()
 Update position of objects This function updates the position of all animated, updating view table entries according to its motion type, step size, etc. More...
 
int getDirection (int16 objX, int16 objY, int16 destX, int16 destY, int16 stepSize)
 Get direction from motion coordinates This function gets the motion direction from the current and previous object coordinates and the step size. More...
 
int doPollKeyboard ()
 Raw key grabber. More...
 
void cleanKeyboard ()
 
bool handleMouseClicks (uint16 &key)
 
bool handleController (uint16 key)
 
bool showPredictiveDialog ()
 
uint16 agiGetKeypress ()
 
int waitKey ()
 
int waitAnyKey ()
 
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 ()
 
void inGameTimerPause ()
 
void inGameTimerResume ()
 
uint32 inGameTimerGet ()
 
uint32 inGameTimerGetPassedCycles ()
 
void inGameTimerUpdate ()
 
const AgiOpCodeEntrygetOpCodesTable ()
 
- Public Member Functions inherited from Agi::AgiBase
 AgiBase (OSystem *syst, const AGIGameDescription *gameDesc)
 
 ~AgiBase ()
 
bool getFlag (int16 flagNr)
 
void setFlag (int16 flagNr, bool newState)
 
void flipFlag (int16 flagNr)
 
uint32 getGameID () const
 
uint32 getFeatures () const
 
uint16 getVersion () const
 
uint16 getGameType () const
 
Common::Language getLanguage () const
 
Common::Platform getPlatform () const
 
const char * getGameMD5 () const
 
void initFeatures ()
 
void setFeature (uint32 feature)
 
void initVersion ()
 
void setVersion (uint16 version)
 
const char * getDiskName (uint16 id)
 
bool canLoadGameStateCurrently ()
 Indicates whether a game state can be loaded. More...
 
bool canSaveGameStateCurrently ()
 Indicates whether a game state can be saved. More...
 
const bytegetFontData ()
 
void cycleInnerLoopActive (int16 loopType)
 
void cycleInnerLoopInactive ()
 
bool cycleInnerLoopIsActive ()
 
- Public Member Functions inherited from Engine
void pauseEngine (bool pause)
 Pause or resume the engine. More...
 
bool isPaused () const
 Return whether the engine is currently paused or not. More...
 
void openMainMenuDialog ()
 Run the Global Main Menu Dialog. More...
 
uint32 getTotalPlayTime () const
 Get the total play time. More...
 
void setTotalPlayTime (uint32 time=0)
 Set the game time counter to the specified time. More...
 
Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
Common::SaveFileManagergetSaveFileManager ()
 
void checkCD ()
 On some systems, check if the game appears to be run from CD. More...
 
 Engine (OSystem *syst)
 
virtual ~Engine ()
 
virtual void initializePath (const Common::FSNode &gamePath)
 Init SearchMan according to the game path. More...
 
virtual void errorString (const char *buf_input, char *buf_output, int buf_output_size)
 Prepare an error string, which is printed by the error() function. More...
 
virtual void initKeymap ()
 
virtual void deinitKeymap ()
 
virtual void flipMute ()
 Flip mute all sound option. More...
 
void setGameToLoadSlot (int slot)
 Sets the game slot for a savegame to be loaded after global main menu execution. More...
 

Public Attributes

Common::Array< AgiObject_objects
 
StringData _stringdata
 
uint8_intobj
 
bool _restartGame
 
SpritesMgr_sprites
 
TextMgr_text
 
InventoryMgr_inventory
 
PictureMgr_picture
 
AgiLoader_loader
 
GfxMenu_menu
 
SystemUI_systemUI
 
Common::Stack< ImageStackElement_imageStack
 
Console_console
 
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

virtual Common::Error go ()
 
void initialize ()
 
- Protected Member Functions inherited from Agi::AgiBase
Common::Error init ()
 
virtual Common::Error run ()
 Init the engine and start its main loop. More...
 
virtual bool hasFeature (EngineFeature f) const
 Determine whether the engine supports the specified feature. More...
 
void initRenderMode ()
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
bool shouldPerformAutoSave (int lastSaveTime)
 Indicate whether an autosave should be performed. More...
 
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...
 

Protected Attributes

uint32 _lastSaveTime
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Private Member Functions

bool checkPriority (ScreenObjEntry *v)
 
bool checkCollision (ScreenObjEntry *v)
 Check if there's another object on the way. More...
 
bool checkPosition (ScreenObjEntry *v)
 
void setVolumeViaScripts (byte newVolume)
 
void setVolumeViaSystemSetting ()
 
int decodeObjects (uint8 *mem, uint32 flen)
 
int readObjects (Common::File &fp, int flen)
 Read and decode objects, and store them in the internal structure. More...
 
void resetGetVarSecondsHeuristic ()
 
void getVarSecondsHeuristicTrigger ()
 
void setVarSecondsTrigger (byte newSeconds)
 
void lSetLoop (ScreenObjEntry *screenObj, int16 loopNr)
 
void updateView (ScreenObjEntry *screenObj)
 
void unpackViewCelData (AgiViewCel *celData, byte *compressedData, uint16 compressedSize)
 
void unpackViewCelDataAGI256 (AgiViewCel *celData, byte *compressedData, uint16 compressedSize)
 
int checkStep (int delta, int step)
 
bool checkBlock (int16 x, int16 y)
 
void changePos (ScreenObjEntry *screenObj)
 
void motionWander (ScreenObjEntry *screenObj)
 
void motionFollowEgo (ScreenObjEntry *screenObj)
 
void motionMoveObj (ScreenObjEntry *screenObj)
 
void motionMoveObjStop (ScreenObjEntry *screenObj)
 
void checkMotion (ScreenObjEntry *screenObj)
 
void setupOpCodes (uint16 version)
 

Private Attributes

int _keyQueue [KEY_QUEUE_SIZE]
 
int _keyQueueStart
 
int _keyQueueEnd
 
bool _allowSynthetic
 
int _firstSlot
 
bool _veryFirstInitialCycle
 signals, that currently the very first cycle is executed (restarts, etc. More...
 
uint32 _instructionCounter
 counts every instruction, that got executed, can wrap around More...
 
bool _setVolumeBrokenFangame
 
uint32 _getVarSecondsHeuristicLastInstructionCounter
 last time VM_VAR_SECONDS were read More...
 
uint16 _getVarSecondsHeuristicCounter
 how many times heuristic was triggered More...
 
uint32 _playTimeInSecondsAdjust
 milliseconds to adjust for calculating current play time in seconds, see setVarSecondsTrigger() More...
 
int16 _artificialDelayCurrentRoom
 
int16 _artificialDelayCurrentPicture
 
uint32 _lastUsedPlayTimeInCycles
 
uint32 _lastUsedPlayTimeInSeconds
 
uint32 _passedPlayTimeCycles
 
AgiOpCodeEntry _opCodes [256]
 
AgiOpCodeEntry _opCodesCond [256]
 

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsRTL, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsJoystick
}
 A feature in this context means an ability of the engine which can be either available or not. More...
 
- Static Public Member Functions inherited from Engine
static void quitGame ()
 Request the engine to quit. More...
 
static bool shouldQuit ()
 Return whether the ENGINE should quit respectively should return to the launcher. More...
 
static bool warnUserAboutUnsupportedGame ()
 Display a warning to the user that the game is not fully supported. More...
 

Detailed Description

Definition at line 844 of file agi.h.

Constructor & Destructor Documentation

◆ AgiEngine()

Agi::AgiEngine::AgiEngine ( OSystem syst,
const AGIGameDescription gameDesc 
)

Definition at line 351 of file agi.cpp.

◆ ~AgiEngine()

Agi::AgiEngine::~AgiEngine ( )
virtual

Definition at line 519 of file agi.cpp.

Member Function Documentation

◆ addToPic()

void Agi::AgiEngine::addToPic ( int  ,
int  ,
int  ,
int  ,
int  ,
int  ,
int   
)

◆ agiDeinit()

int Agi::AgiEngine::agiDeinit ( )

Definition at line 211 of file agi.cpp.

◆ agiDetectGame()

int Agi::AgiEngine::agiDetectGame ( )

Definition at line 645 of file detection.cpp.

◆ agiGetKeypress()

uint16 Agi::AgiEngine::agiGetKeypress ( )

◆ agiInit()

int Agi::AgiEngine::agiInit ( )

Definition at line 79 of file agi.cpp.

◆ agiLoadResource()

int Agi::AgiEngine::agiLoadResource ( int16  resourceType,
int16  resourceNr 
)

Definition at line 229 of file agi.cpp.

◆ agiUnloadResource()

int Agi::AgiEngine::agiUnloadResource ( int16  resourceType,
int16  resourceNr 
)

Definition at line 253 of file agi.cpp.

◆ agiUnloadResources()

void Agi::AgiEngine::agiUnloadResources ( )

Definition at line 197 of file agi.cpp.

◆ allowSynthetic()

void Agi::AgiEngine::allowSynthetic ( bool  allow)

Definition at line 56 of file agi.cpp.

◆ artificialDelay_CycleDone()

void Agi::AgiEngine::artificialDelay_CycleDone ( )

Definition at line 607 of file agi.cpp.

◆ artificialDelay_Reset()

void Agi::AgiEngine::artificialDelay_Reset ( )

Definition at line 601 of file agi.cpp.

◆ artificialDelay_SearchTable()

uint16 Agi::AgiEngine::artificialDelay_SearchTable ( AgiArtificialDelayTriggerType  triggerType,
int16  orgNr,
int16  newNr 
)

Definition at line 638 of file agi.cpp.

◆ artificialDelayTrigger_DrawPicture()

void Agi::AgiEngine::artificialDelayTrigger_DrawPicture ( int16  newPictureNr)

Definition at line 686 of file agi.cpp.

◆ artificialDelayTrigger_NewRoom()

void Agi::AgiEngine::artificialDelayTrigger_NewRoom ( int16  newRoomNr)

Definition at line 660 of file agi.cpp.

◆ changePos()

void Agi::AgiEngine::changePos ( ScreenObjEntry screenObj)
private

Definition at line 42 of file motion.cpp.

◆ checkAllMotions()

void Agi::AgiEngine::checkAllMotions ( )

Definition at line 239 of file motion.cpp.

◆ checkBlock()

bool Agi::AgiEngine::checkBlock ( int16  x,
int16  y 
)
private

Definition at line 32 of file motion.cpp.

◆ checkCollision()

bool Agi::AgiEngine::checkCollision ( ScreenObjEntry v)
private

Check if there's another object on the way.

Definition at line 69 of file checks.cpp.

◆ checkMotion()

void Agi::AgiEngine::checkMotion ( ScreenObjEntry screenObj)
private

Definition at line 210 of file motion.cpp.

◆ checkPosition()

bool Agi::AgiEngine::checkPosition ( ScreenObjEntry v)
private

Definition at line 28 of file checks.cpp.

◆ checkPriority()

bool Agi::AgiEngine::checkPriority ( ScreenObjEntry v)
private

Definition at line 107 of file checks.cpp.

◆ checkQuickLoad()

void Agi::AgiEngine::checkQuickLoad ( )

Definition at line 1057 of file saveload.cpp.

◆ checkStep()

int Agi::AgiEngine::checkStep ( int  delta,
int  step 
)
private

Definition at line 28 of file motion.cpp.

◆ cleanKeyboard()

void Agi::AgiEngine::cleanKeyboard ( )

◆ clearImageStack()

void Agi::AgiEngine::clearImageStack ( )
virtual

Implements Agi::AgiBase.

Definition at line 1049 of file saveload.cpp.

◆ clearKeyQueue()

void Agi::AgiEngine::clearKeyQueue ( )
virtual

Implements Agi::AgiBase.

Definition at line 640 of file keyboard.cpp.

◆ clipViewCoordinates()

void Agi::AgiEngine::clipViewCoordinates ( ScreenObjEntry screenObj)

Restrict view table entry's position so it stays wholly inside the screen.

Also take horizon into account when clipping if not set to ignore it.

Parameters
vpointer to view table entry

Definition at line 569 of file view.cpp.

◆ cyclerActivated()

void Agi::AgiEngine::cyclerActivated ( ScreenObjEntry screenObj)

Definition at line 96 of file motion.cpp.

◆ debugConsole()

void Agi::AgiEngine::debugConsole ( int  lognum,
int  mode,
const char *  str 
)

Definition at line 35 of file op_dbg.cpp.

◆ decodeLogic()

int Agi::AgiEngine::decodeLogic ( int16  logicNr)

Decode logic resource This function decodes messages from the specified raw logic resource into a message list.

Parameters
nThe number of the logic resource to decode.

Definition at line 33 of file logic.cpp.

◆ decodeObjects()

int Agi::AgiEngine::decodeObjects ( uint8 mem,
uint32  flen 
)
private

Definition at line 29 of file objects.cpp.

◆ decodeView()

int Agi::AgiEngine::decodeView ( byte resourceData,
uint16  resourceSize,
int16  viewNr 
)

Decode an AGI view resource.

This function decodes the raw data of the specified AGI view resource and fills the corresponding views array element.

Parameters
nnumber of view resource to decode

Definition at line 92 of file view.cpp.

◆ decrypt()

void Agi::AgiEngine::decrypt ( uint8 mem,
int  len 
)

Definition at line 330 of file global.cpp.

◆ doLoad()

int Agi::AgiEngine::doLoad ( int  slot,
bool  showMessages 
)

Definition at line 801 of file saveload.cpp.

◆ doPollKeyboard()

int Agi::AgiEngine::doPollKeyboard ( )

Raw key grabber.

poll_keyboard() is the raw key grabber (above the gfx driver, that is). It handles console keys and insulates AGI from the console. In the main loop, handle_keys() handles keyboard input and ego movement.

Definition at line 326 of file keyboard.cpp.

◆ doSave()

int Agi::AgiEngine::doSave ( int  slot,
const Common::String desc 
)

Definition at line 789 of file saveload.cpp.

◆ drawObj()

void Agi::AgiEngine::drawObj ( int  )

◆ executeAgiCommand()

void Agi::AgiEngine::executeAgiCommand ( uint8  op,
uint8 p 
)

Definition at line 2434 of file op_cmd.cpp.

◆ fixPosition() [1/2]

void Agi::AgiEngine::fixPosition ( int16  screenObjNr)

Adjust position of a sprite This function adjusts the position of a sprite moving it until certain criteria is matched.

According to priority and control line data, a sprite may not always appear at the location we specified. This behavior is also known as the "Budin-Sonneveld effect".

Parameters
nview table entry number

Definition at line 297 of file checks.cpp.

◆ fixPosition() [2/2]

void Agi::AgiEngine::fixPosition ( ScreenObjEntry screenObj)

Definition at line 302 of file checks.cpp.

◆ getAppDir()

int Agi::AgiEngine::getAppDir ( char *  appDir,
unsigned int  size 
)

◆ getDebugger()

GUI::Debugger* Agi::AgiEngine::getDebugger ( )
inlinevirtual

Return the engine's debugger instance, if any.

Used by error() to invoke the debugger when a severe error is reported.

Reimplemented from Engine.

Definition at line 917 of file agi.h.

◆ getDirection()

int Agi::AgiEngine::getDirection ( int16  objX,
int16  objY,
int16  destX,
int16  destY,
int16  stepSize 
)

Get direction from motion coordinates This function gets the motion direction from the current and previous object coordinates and the step size.

Parameters
x0Original x coordinate of the object
y0Original y coordinate of the object
xx coordinate of the object
yy coordinate of the object
sstep size

Definition at line 302 of file motion.cpp.

◆ getKeypress()

int Agi::AgiEngine::getKeypress ( )
virtual

Implements Agi::AgiBase.

Definition at line 629 of file keyboard.cpp.

◆ getOpCodesTable()

const AgiOpCodeEntry* Agi::AgiEngine::getOpCodesTable ( )
inline

Definition at line 1113 of file agi.h.

◆ getSavegameFilename()

Common::String Agi::AgiEngine::getSavegameFilename ( int16  slotId) const

Definition at line 850 of file saveload.cpp.

◆ getSavegameInformation()

bool Agi::AgiEngine::getSavegameInformation ( int16  slotId,
Common::String saveDescription,
uint32 saveDate,
uint32 saveTime,
bool &  saveIsValid 
)

Definition at line 856 of file saveload.cpp.

◆ getSavegameSlotIds()

SavedGameSlotIdArray Agi::AgiEngine::getSavegameSlotIds ( )

Definition at line 822 of file saveload.cpp.

◆ getVar()

byte Agi::AgiEngine::getVar ( int16  varNr)

Definition at line 70 of file global.cpp.

◆ getVarSecondsHeuristicTrigger()

void Agi::AgiEngine::getVarSecondsHeuristicTrigger ( )
private

Definition at line 180 of file global.cpp.

◆ go()

Common::Error Agi::AgiEngine::go ( )
protectedvirtual

Implements Agi::AgiBase.

Definition at line 545 of file agi.cpp.

◆ handleController()

bool Agi::AgiEngine::handleController ( uint16  key)

Definition at line 415 of file keyboard.cpp.

◆ handleMouseClicks()

bool Agi::AgiEngine::handleMouseClicks ( uint16 key)

Definition at line 339 of file keyboard.cpp.

◆ inDestination()

void Agi::AgiEngine::inDestination ( ScreenObjEntry screenObj)

Check if given entry is at destination point.

This function is used to updated the flags of an object with move.obj type motion that * has reached its final destination coordinates.

Parameters
vPointer to view table entry

Definition at line 256 of file motion.cpp.

◆ inGameTimerGet()

uint32 Agi::AgiEngine::inGameTimerGet ( )

Definition at line 222 of file global.cpp.

◆ inGameTimerGetPassedCycles()

uint32 Agi::AgiEngine::inGameTimerGetPassedCycles ( )

Definition at line 225 of file global.cpp.

◆ inGameTimerPause()

void Agi::AgiEngine::inGameTimerPause ( )

Definition at line 216 of file global.cpp.

◆ inGameTimerReset()

void Agi::AgiEngine::inGameTimerReset ( uint32  newPlayTime = 0)

Definition at line 206 of file global.cpp.

◆ inGameTimerResetPassedCycles()

void Agi::AgiEngine::inGameTimerResetPassedCycles ( )

Definition at line 213 of file global.cpp.

◆ inGameTimerResume()

void Agi::AgiEngine::inGameTimerResume ( )

Definition at line 219 of file global.cpp.

◆ inGameTimerUpdate()

void Agi::AgiEngine::inGameTimerUpdate ( )

Definition at line 250 of file global.cpp.

◆ initialize()

void Agi::AgiEngine::initialize ( )
protectedvirtual

Implements Agi::AgiBase.

Definition at line 431 of file agi.cpp.

◆ interpretCycle()

void Agi::AgiEngine::interpretCycle ( )

Definition at line 132 of file cycle.cpp.

◆ isEgoView()

bool Agi::AgiEngine::isEgoView ( const ScreenObjEntry screenObj)

Definition at line 689 of file view.cpp.

◆ isKeypress()

bool Agi::AgiEngine::isKeypress ( )
virtual

Implements Agi::AgiBase.

Definition at line 624 of file keyboard.cpp.

◆ loadGame()

int Agi::AgiEngine::loadGame ( const Common::String fileName,
bool  checkId = true 
)

Definition at line 340 of file saveload.cpp.

◆ loadGameAutomatic()

bool Agi::AgiEngine::loadGameAutomatic ( )

Definition at line 943 of file saveload.cpp.

◆ loadGameDialog()

bool Agi::AgiEngine::loadGameDialog ( )

Definition at line 955 of file saveload.cpp.

◆ loadGameState()

Common::Error Agi::AgiEngine::loadGameState ( int  slot)
virtual

Load a game state.

Parameters
slotthe slot from which a savestate should be loaded
Returns
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 1071 of file saveload.cpp.

◆ loadObjects() [1/2]

int Agi::AgiEngine::loadObjects ( const char *  fname)

Definition at line 82 of file objects.cpp.

◆ loadObjects() [2/2]

int Agi::AgiEngine::loadObjects ( Common::File fp)

Loads an object file that is in the common VOL resource format.

Expects the file pointer to point to the last field in header, ie. file length. This is used at least by the V1 booter games.

Definition at line 98 of file objects.cpp.

◆ lSetLoop()

void Agi::AgiEngine::lSetLoop ( ScreenObjEntry screenObj,
int16  loopNr 
)
private

◆ motionActivated()

void Agi::AgiEngine::motionActivated ( ScreenObjEntry screenObj)

Definition at line 74 of file motion.cpp.

◆ motionFollowEgo()

void Agi::AgiEngine::motionFollowEgo ( ScreenObjEntry screenObj)
private

Definition at line 136 of file motion.cpp.

◆ motionMoveObj()

void Agi::AgiEngine::motionMoveObj ( ScreenObjEntry screenObj)
private

Definition at line 199 of file motion.cpp.

◆ motionMoveObjStop()

void Agi::AgiEngine::motionMoveObjStop ( ScreenObjEntry screenObj)
private

Definition at line 266 of file motion.cpp.

◆ motionWander()

void Agi::AgiEngine::motionWander ( ScreenObjEntry screenObj)
private

Definition at line 119 of file motion.cpp.

◆ moveObj()

void Agi::AgiEngine::moveObj ( ScreenObjEntry screenObj)

Wrapper for static function motion_moveobj().

This function is used by cmd_move_object() in the first motion cycle after setting the motion mode to kMotionMoveObj.

Parameters
vPointer to view table entry

Definition at line 288 of file motion.cpp.

◆ newRoom()

void Agi::AgiEngine::newRoom ( int16  newRoomNr)

Set up new room.

This function is called when ego enters a new room.

Parameters
nroom number

Definition at line 42 of file cycle.cpp.

◆ nonBlockingText_Forget()

void Agi::AgiEngine::nonBlockingText_Forget ( )

Definition at line 596 of file agi.cpp.

◆ nonBlockingText_IsShown()

void Agi::AgiEngine::nonBlockingText_IsShown ( )

Definition at line 592 of file agi.cpp.

◆ objectGetLocation()

int Agi::AgiEngine::objectGetLocation ( uint16  objectNr)

Definition at line 133 of file objects.cpp.

◆ objectName()

const char * Agi::AgiEngine::objectName ( uint16  objectNr)

Definition at line 141 of file objects.cpp.

◆ objectSetLocation()

void Agi::AgiEngine::objectSetLocation ( uint16  objectNr,
int  i 
)

Definition at line 125 of file objects.cpp.

◆ playGame()

int Agi::AgiEngine::playGame ( )

Definition at line 298 of file cycle.cpp.

◆ processAGIEvents()

uint16 Agi::AgiEngine::processAGIEvents ( )

Definition at line 185 of file cycle.cpp.

◆ processScummVMEvents()

void Agi::AgiEngine::processScummVMEvents ( )

Definition at line 66 of file keyboard.cpp.

◆ promptIsEnabled()

bool Agi::AgiEngine::promptIsEnabled ( )
virtual

Reimplemented from Agi::AgiBase.

Definition at line 505 of file agi.cpp.

◆ readObjects()

int Agi::AgiEngine::readObjects ( Common::File fp,
int  flen 
)
private

Read and decode objects, and store them in the internal structure.

Parameters
fpFile pointer
flenFile length

Definition at line 109 of file objects.cpp.

◆ recordImageStackCall()

void Agi::AgiEngine::recordImageStackCall ( uint8  type,
int16  p1,
int16  p2,
int16  p3,
int16  p4,
int16  p5,
int16  p6,
int16  p7 
)
virtual

Implements Agi::AgiBase.

Definition at line 1015 of file saveload.cpp.

◆ redrawScreen()

void Agi::AgiEngine::redrawScreen ( )

Definition at line 509 of file agi.cpp.

◆ releaseImageStack()

void Agi::AgiEngine::releaseImageStack ( )
virtual

Implements Agi::AgiBase.

Definition at line 1053 of file saveload.cpp.

◆ releaseSprites()

void Agi::AgiEngine::releaseSprites ( )

◆ replayImageStackCall()

void Agi::AgiEngine::replayImageStackCall ( uint8  type,
int16  p1,
int16  p2,
int16  p3,
int16  p4,
int16  p5,
int16  p6,
int16  p7 
)
virtual

Implements Agi::AgiBase.

Definition at line 1032 of file saveload.cpp.

◆ resetControllers()

void Agi::AgiEngine::resetControllers ( )

Definition at line 124 of file cycle.cpp.

◆ resetGetVarSecondsHeuristic()

void Agi::AgiEngine::resetGetVarSecondsHeuristic ( )
private

Definition at line 174 of file global.cpp.

◆ runGame()

int Agi::AgiEngine::runGame ( )

Definition at line 470 of file cycle.cpp.

◆ runLogic()

int Agi::AgiEngine::runLogic ( int16  logicNr)

Execute a logic script.

Parameters
nNumber of the logic resource to execute

Definition at line 2317 of file op_cmd.cpp.

◆ saveGame()

int Agi::AgiEngine::saveGame ( const Common::String fileName,
const Common::String descriptionString 
)

Definition at line 72 of file saveload.cpp.

◆ saveGameAutomatic()

bool Agi::AgiEngine::saveGameAutomatic ( )

Definition at line 977 of file saveload.cpp.

◆ saveGameDialog()

bool Agi::AgiEngine::saveGameDialog ( )

Definition at line 996 of file saveload.cpp.

◆ saveGameState()

Common::Error Agi::AgiEngine::saveGameState ( int  slot,
const Common::String desc 
)
virtual

Save a game state.

Parameters
slotthe slot into which the savestate should be stored
desca description for the savestate, entered by the user
Returns
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 1086 of file saveload.cpp.

◆ scummVMSaveLoadDialog()

int Agi::AgiEngine::scummVMSaveLoadDialog ( bool  isSave)

Definition at line 755 of file saveload.cpp.

◆ setCel()

void Agi::AgiEngine::setCel ( ScreenObjEntry screenObj,
int16  celNr 
)

Set a view table entry to use the specified cel of the current loop.

Parameters
screenObjpointer to screen object
celNrnumber of cel

Definition at line 518 of file view.cpp.

◆ setLoop()

void Agi::AgiEngine::setLoop ( ScreenObjEntry screenObj,
int16  loopNr 
)

Set a view table entry to use the specified loop of the current view.

Parameters
screenObjpointer to screen object
loopNrnumber of loop

Definition at line 471 of file view.cpp.

◆ setupOpCodes()

void Agi::AgiEngine::setupOpCodes ( uint16  version)
private

Definition at line 365 of file opcodes.cpp.

◆ setupV2Game()

int Agi::AgiEngine::setupV2Game ( int  ver)

◆ setupV3Game()

int Agi::AgiEngine::setupV3Game ( int  ver)

◆ setVar()

void Agi::AgiEngine::setVar ( int16  varNr,
byte  newValue 
)

Definition at line 55 of file global.cpp.

◆ setVarSecondsTrigger()

void Agi::AgiEngine::setVarSecondsTrigger ( byte  newSeconds)
private

Definition at line 235 of file global.cpp.

◆ setView()

void Agi::AgiEngine::setView ( ScreenObjEntry screenObj,
int16  viewNr 
)

Set a view table entry to use the specified view resource.

Parameters
screenObjpointer to screen object
viewNrnumber of AGI view resource

Definition at line 434 of file view.cpp.

◆ setVolumeViaScripts()

void Agi::AgiEngine::setVolumeViaScripts ( byte  newVolume)
private

Definition at line 91 of file global.cpp.

◆ setVolumeViaSystemSetting()

void Agi::AgiEngine::setVolumeViaSystemSetting ( )
private

Definition at line 138 of file global.cpp.

◆ showObjects()

int Agi::AgiEngine::showObjects ( )

◆ showPredictiveDialog()

bool Agi::AgiEngine::showPredictiveDialog ( )

Definition at line 559 of file keyboard.cpp.

◆ skipInstruction()

void Agi::AgiEngine::skipInstruction ( byte  op)

Definition at line 473 of file op_test.cpp.

◆ skipInstructionsUntil()

void Agi::AgiEngine::skipInstructionsUntil ( byte  v)

Definition at line 484 of file op_test.cpp.

◆ startUpdate()

void Agi::AgiEngine::startUpdate ( ScreenObjEntry v)

Set the view table entry as updating.

Parameters
vpointer to view table entry

Definition at line 593 of file view.cpp.

◆ stopUpdate()

void Agi::AgiEngine::stopUpdate ( ScreenObjEntry viewPtr)

Set the view table entry as non-updating.

Parameters
vpointer to view table entry

Definition at line 606 of file view.cpp.

◆ syncSoundSettings()

void Agi::AgiEngine::syncSoundSettings ( )
virtual

Notify the engine that the sound settings in the config manager may have changed and that it hence should adjust any internal volume etc.

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.
Todo:
find a better name for this

Reimplemented from Engine.

Definition at line 556 of file agi.cpp.

◆ testCompareStrings()

uint8 Agi::AgiEngine::testCompareStrings ( uint8  s1,
uint8  s2 
)

Definition at line 229 of file op_test.cpp.

◆ testController()

uint8 Agi::AgiEngine::testController ( uint8  cont)

Definition at line 282 of file op_test.cpp.

◆ testIfCode()

bool Agi::AgiEngine::testIfCode ( int16  logicNr)

Definition at line 379 of file op_test.cpp.

◆ testObjCenter()

uint8 Agi::AgiEngine::testObjCenter ( uint8  n,
uint8  x1,
uint8  y1,
uint8  x2,
uint8  y2 
)

Definition at line 305 of file op_test.cpp.

◆ testObjInBox()

uint8 Agi::AgiEngine::testObjInBox ( uint8  n,
uint8  x1,
uint8  y1,
uint8  x2,
uint8  y2 
)

Definition at line 297 of file op_test.cpp.

◆ testObjRight()

uint8 Agi::AgiEngine::testObjRight ( uint8  n,
uint8  x1,
uint8  y1,
uint8  x2,
uint8  y2 
)

Definition at line 313 of file op_test.cpp.

◆ testPosn()

uint8 Agi::AgiEngine::testPosn ( uint8  n,
uint8  x1,
uint8  y1,
uint8  x2,
uint8  y2 
)

Definition at line 286 of file op_test.cpp.

◆ testSaid()

uint8 Agi::AgiEngine::testSaid ( uint8  nwords,
uint8 cc 
)

Definition at line 321 of file op_test.cpp.

◆ unloadLogic()

void Agi::AgiEngine::unloadLogic ( int16  logicNr)

Unload logic resource This function unloads the specified logic resource, freeing any memory chunks allocated for this resource.

Parameters
nThe number of the logic resource to unload

Definition at line 96 of file logic.cpp.

◆ unloadView()

void Agi::AgiEngine::unloadView ( int16  viewNr)

Unloads all data in a view resource.

Parameters
nnumber of view resource

Definition at line 391 of file view.cpp.

◆ unpackViewCelData()

void Agi::AgiEngine::unpackViewCelData ( AgiViewCel celData,
byte compressedData,
uint16  compressedSize 
)
private

Definition at line 262 of file view.cpp.

◆ unpackViewCelDataAGI256()

void Agi::AgiEngine::unpackViewCelDataAGI256 ( AgiViewCel celData,
byte compressedData,
uint16  compressedSize 
)
private

Definition at line 347 of file view.cpp.

◆ updatePosition()

void Agi::AgiEngine::updatePosition ( )

Update position of objects This function updates the position of all animated, updating view table entries according to its motion type, step size, etc.

The new position must be valid according to the sprite positioning rules, otherwise the previous position will be kept.

Definition at line 184 of file checks.cpp.

◆ updateScreenObjTable()

void Agi::AgiEngine::updateScreenObjTable ( )

Update view table entries.

This function is called at the end of each interpreter cycle to update the view table entries and blit the sprites.

Definition at line 630 of file view.cpp.

◆ updateView()

void Agi::AgiEngine::updateView ( ScreenObjEntry screenObj)
private

Definition at line 29 of file view.cpp.

◆ viewPictures()

int Agi::AgiEngine::viewPictures ( )

◆ wait()

void Agi::AgiEngine::wait ( uint32  msec,
bool  busy = false 
)

Definition at line 60 of file agi.cpp.

◆ waitAnyKey()

int Agi::AgiEngine::waitAnyKey ( )

Definition at line 609 of file keyboard.cpp.

◆ waitKey()

int Agi::AgiEngine::waitKey ( )

Definition at line 594 of file keyboard.cpp.

Member Data Documentation

◆ _allowSynthetic

bool Agi::AgiEngine::_allowSynthetic
private

Definition at line 867 of file agi.h.

◆ _artificialDelayCurrentPicture

int16 Agi::AgiEngine::_artificialDelayCurrentPicture
private

Definition at line 1087 of file agi.h.

◆ _artificialDelayCurrentRoom

int16 Agi::AgiEngine::_artificialDelayCurrentRoom
private

Definition at line 1086 of file agi.h.

◆ _console

Console* Agi::AgiEngine::_console

Definition at line 916 of file agi.h.

◆ _firstSlot

int Agi::AgiEngine::_firstSlot
private

Definition at line 873 of file agi.h.

◆ _getVarSecondsHeuristicCounter

uint16 Agi::AgiEngine::_getVarSecondsHeuristicCounter
private

how many times heuristic was triggered

Definition at line 990 of file agi.h.

◆ _getVarSecondsHeuristicLastInstructionCounter

uint32 Agi::AgiEngine::_getVarSecondsHeuristicLastInstructionCounter
private

last time VM_VAR_SECONDS were read

Definition at line 989 of file agi.h.

◆ _imageStack

Common::Stack<ImageStackElement> Agi::AgiEngine::_imageStack

Definition at line 905 of file agi.h.

◆ _instructionCounter

uint32 Agi::AgiEngine::_instructionCounter
private

counts every instruction, that got executed, can wrap around

Definition at line 983 of file agi.h.

◆ _intobj

uint8* Agi::AgiEngine::_intobj

Definition at line 894 of file agi.h.

◆ _inventory

InventoryMgr* Agi::AgiEngine::_inventory

Definition at line 899 of file agi.h.

◆ _keyHoldMode

bool Agi::AgiEngine::_keyHoldMode

Definition at line 1058 of file agi.h.

◆ _keyHoldModeLastKey

Common::KeyCode Agi::AgiEngine::_keyHoldModeLastKey

Definition at line 1059 of file agi.h.

◆ _keyQueue

int Agi::AgiEngine::_keyQueue[KEY_QUEUE_SIZE]
private

Definition at line 863 of file agi.h.

◆ _keyQueueEnd

int Agi::AgiEngine::_keyQueueEnd
private

Definition at line 865 of file agi.h.

◆ _keyQueueStart

int Agi::AgiEngine::_keyQueueStart
private

Definition at line 864 of file agi.h.

◆ _lastSaveTime

uint32 Agi::AgiEngine::_lastSaveTime
protected

Definition at line 851 of file agi.h.

◆ _lastUsedPlayTimeInCycles

uint32 Agi::AgiEngine::_lastUsedPlayTimeInCycles
private

Definition at line 1102 of file agi.h.

◆ _lastUsedPlayTimeInSeconds

uint32 Agi::AgiEngine::_lastUsedPlayTimeInSeconds
private

Definition at line 1103 of file agi.h.

◆ _loader

AgiLoader* Agi::AgiEngine::_loader

Definition at line 901 of file agi.h.

◆ _menu

GfxMenu* Agi::AgiEngine::_menu

Definition at line 902 of file agi.h.

◆ _objects

Common::Array<AgiObject> Agi::AgiEngine::_objects

Definition at line 876 of file agi.h.

◆ _opCodes

AgiOpCodeEntry Agi::AgiEngine::_opCodes[256]
private

Definition at line 1107 of file agi.h.

◆ _opCodesCond

AgiOpCodeEntry Agi::AgiEngine::_opCodesCond[256]
private

Definition at line 1108 of file agi.h.

◆ _passedPlayTimeCycles

uint32 Agi::AgiEngine::_passedPlayTimeCycles
private

Definition at line 1104 of file agi.h.

◆ _picture

PictureMgr* Agi::AgiEngine::_picture

Definition at line 900 of file agi.h.

◆ _playTimeInSecondsAdjust

uint32 Agi::AgiEngine::_playTimeInSecondsAdjust
private

milliseconds to adjust for calculating current play time in seconds, see setVarSecondsTrigger()

Definition at line 992 of file agi.h.

◆ _restartGame

bool Agi::AgiEngine::_restartGame

Definition at line 895 of file agi.h.

◆ _setVolumeBrokenFangame

bool Agi::AgiEngine::_setVolumeBrokenFangame
private

Definition at line 985 of file agi.h.

◆ _sprites

SpritesMgr* Agi::AgiEngine::_sprites

Definition at line 897 of file agi.h.

◆ _stringdata

StringData Agi::AgiEngine::_stringdata

Definition at line 878 of file agi.h.

◆ _systemUI

SystemUI* Agi::AgiEngine::_systemUI

Definition at line 903 of file agi.h.

◆ _text

TextMgr* Agi::AgiEngine::_text

Definition at line 898 of file agi.h.

◆ _veryFirstInitialCycle

bool Agi::AgiEngine::_veryFirstInitialCycle
private

signals, that currently the very first cycle is executed (restarts, etc.

do not count!)

Definition at line 982 of file agi.h.


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