ScummVM API documentation
Saga::Script Class Reference
Inheritance diagram for Saga::Script:
Saga::SAGA1Script

Classes

struct  ScriptFunctionDescription
 
struct  ScriptOpDescription
 

Public Member Functions

 Script (SagaEngine *vm)
 
void loadModule (uint scriptModuleNumber)
 
void clearModules ()
 
void doVerb ()
 
void showVerb (int statusColor=-1)
 
void setVerb (int verb)
 
int getCurrentVerb () const
 
void setPointerVerb ()
 
void whichObject (const Point &mousePoint)
 
void hitObject (bool leftButton)
 
void playfieldClick (const Point &mousePoint, bool leftButton)
 
void setLeftButtonVerb (int verb)
 
int getLeftButtonVerb () const
 
void setRightButtonVerb (int verb)
 
int getRightButtonVerb () const
 
void setNonPlayfieldVerb ()
 
void setNoPendingVerb ()
 
int getVerbType (VerbTypes verbType)
 
TextListEntry * getPlacardTextEntry ()
 
bool isNonInteractiveDemo ()
 
ScriptThread & createThread (uint16 scriptModuleNumber, uint16 scriptEntryPointNumber)
 
int executeThread (ScriptThread *thread, int entrypointNumber)
 
void executeThreads (uint msec)
 
void completeThread ()
 
void abortAllThreads ()
 
void wakeUpActorThread (int waitType, void *threadObj)
 
void wakeUpThreads (int waitType)
 
void wakeUpThreadsDelayed (int waitType, int sleepTime)
 
void loadVoiceLUT (VoiceLUT &voiceLUT, const ByteArray &resourceData)
 
void finishDialog (int strID, int replyID, int flags, int bitOffset)
 

Public Attributes

StringsTable _mainStrings
 
uint16 _pendingObject [2]
 
int _pendingVerb
 
uint16 _pointerObject
 
bool _skipSpeeches
 
bool _abortEnabled
 
VoiceLUT _globalVoiceLUT
 

Protected Types

typedef void(Script::* ScriptOpType) (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
typedef void(Script::* ScriptFunctionType) (ScriptThread *thread, int nArgs, bool &disContinue)
 

Protected Member Functions

uint16 readUint16 (byte *addr, byte addrMode)
 
void writeUint16 (byte *addr, uint16 value, byte addrMode)
 
void loadModuleBase (ModuleData &module, const ByteArray &resourceData)
 
bool runThread (ScriptThread &thread)
 
void setThreadEntrypoint (ScriptThread *thread, int entrypointNumber)
 
void setupScriptOpcodeList ()
 
void opDummy (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opNextBlock (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opDup (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opDrop (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opZero (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opOne (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opConstInt (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opStrLit (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opGetFlag (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opGetByte (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opGetInt (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opPutFlag (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opPutByte (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opPutInt (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opPutFlagV (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opPutByteV (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opPutIntV (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opCall (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opCallNear (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opCallFar (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opCcall (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opCcallV (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opCallMember (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opCallMemberV (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opEnter (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opReturn (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opReturnV (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opJmp (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opJmpTrueV (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opJmpFalseV (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opJmpTrue (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opJmpFalse (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opJmpSwitch (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opJmpRandom (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opNegate (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opNot (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opCompl (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opIncV (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opDecV (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opPostInc (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opPostDec (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opAdd (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opSub (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opMul (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opDiv (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opMod (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opEq (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opNe (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opGt (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opLt (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opGe (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opLe (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opRsh (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opLsh (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opAnd (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opOr (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opXor (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opLAnd (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opLOr (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opLXor (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opSpeak (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opDialogBegin (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opDialogEnd (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opReply (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opAnimate (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void opJmpSeedRandom (ScriptThread *thread, Common::SeekableReadStream *scriptS, bool &stopParsing, bool &breakOut)
 
void setupITEScriptFuncList ()
 
void setupIHNMScriptFuncList ()
 
void sfPutString (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfWait (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfTakeObject (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfIsCarried (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfStatusBar (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfMainMode (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptWalkTo (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptDoAction (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetActorFacing (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfStartBgdAnim (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfStopBgdAnim (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfLockUser (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPreDialog (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfKillActorThreads (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfFaceTowards (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetFollower (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptGotoScene (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetObjImage (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetObjName (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfGetObjImage (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfGetNumber (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptOpenDoor (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptCloseDoor (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetBgdAnimSpeed (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfCycleColors (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfDoCenterActor (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfStartBgdAnimSpeed (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptWalkToAsync (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfEnableZone (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetActorState (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptMoveTo (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSceneEq (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfDropObject (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfFinishBgdAnim (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSwapActors (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSimulSpeech (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptWalk (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfCycleFrames (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetFrame (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetPortrait (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetProtagPortrait (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfChainBgdAnim (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptSpecialWalk (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPlaceActor (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfCheckUserInterrupt (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptWalkRelative (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptMoveRelative (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSimulSpeech2 (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPlacard (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPlacardOff (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetProtagState (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfResumeBgdAnim (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfThrowActor (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfWaitWalk (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptSceneID (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfChangeActorScene (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptClimb (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetDoorState (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetActorZ (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptText (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfGetActorX (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfGetActorY (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfEraseDelta (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPlayMusic (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPickClimbOutPos (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfTossRif (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfShowControls (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfShowMap (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPuzzleWon (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfEnableEscape (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPlaySound (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPlayLoopedSound (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfGetDeltaFrame (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfShowProtect (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfProtectResult (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfRand (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfFadeMusic (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptStartCutAway (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfReturnFromCutAway (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfEndCutAway (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfGetMouseClicks (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfResetMouseClicks (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfWaitFrames (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptFade (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPlayVoice (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfVstopFX (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfVstopLoopedFX (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfDemoIsInteractive (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfVsetTrack (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfDebugShowData (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfNull (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfWaitFramesEsc (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPsychicProfile (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfPsychicProfileOff (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetSpeechBox (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetChapterPoints (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetPortraitBgColor (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptStartVideo (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptReturnFromVideo (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfScriptEndVideo (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfShowIHNMDemoHelpBg (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfAddIHNMDemoHelpTextLine (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfShowIHNMDemoHelpPage (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfGetPoints (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetGlobalFlag (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfDemoSetInteractive (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfClearGlobalFlag (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfTestGlobalFlag (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfSetPoints (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfQueueMusic (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfDisableAbortSpeeches (ScriptThread *thread, int nArgs, bool &disContinue)
 
void sfStub (const char *name, ScriptThread *thread, int nArgs)
 

Protected Attributes

SagaEngine * _vm
 
ResourceContext * _scriptContext
 
ResourceContext * _dataContext
 
uint16 _modulesLUTEntryLen
 
Common::Array< ModuleData > _modules
 
TextListEntry * _placardTextEntry
 
ByteArray _commonBuffer
 
uint _staticSize
 
ScriptThreadList _threadList
 
ScriptThread * _conversingThread
 
bool _firstObjectSet
 
bool _secondObjectNeeded
 
uint16 _currentObject [2]
 
int16 _currentObjectFlags [2]
 
int _currentVerb
 
int _stickyVerb
 
int _leftButtonVerb
 
int _rightButtonVerb
 
int _ihnmDemoCurrentY
 
const ScriptOpDescription * _scriptOpsList
 
const ScriptFunctionDescription * _scriptFunctionsList
 

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