ScummVM API documentation
Gob::Script Class Reference

Public Member Functions

 Script (GobEngine *vm)
 
uint32 read (byte *data, int32 size)
 
uint32 peek (byte *data, int32 size, int32 offset=0) const
 
int32 pos () const
 
int32 getSize () const
 
bool seek (int32 offset, int whence=SEEK_SET)
 
bool skip (int32 offset)
 
bool skipBlock ()
 
byte readByte ()
 
char readChar ()
 
uint8 readUint8 ()
 
uint16 readUint16 ()
 
uint32 readUint32 ()
 
int8 readInt8 ()
 
int16 readInt16 ()
 
int32 readInt32 ()
 
char * readString (int32 length=-1)
 
byte peekByte (int32 offset=0)
 
char peekChar (int32 offset=0)
 
uint8 peekUint8 (int32 offset=0)
 
uint16 peekUint16 (int32 offset=0)
 
uint32 peekUint32 (int32 offset=0)
 
int8 peekInt8 (int32 offset=0)
 
int16 peekInt16 (int32 offset=0)
 
int32 peekInt32 (int32 offset=0)
 
char * peekString (int32 offset=0)
 
uint16 readVarIndex (uint16 *size=0, uint16 *type=0)
 
int16 readValExpr (byte stopToken=99)
 
int16 readExpr (byte stopToken, byte *type)
 
void skipExpr (char stopToken)
 
char evalExpr (int16 *pRes)
 
bool evalBool ()
 
int32 evalInt ()
 
const char * evalString ()
 
int32 getResultInt () const
 
char * getResultStr () const
 
int32 getOffset (byte *ptr) const
 
byte * getData (int32 offset) const
 
byte * getData ()
 
bool load (const Common::String &fileName)
 
void unload ()
 
bool isLoaded () const
 
void setFinished (bool finished)
 
bool isFinished () const
 
void push ()
 
void pop (bool ret=true)
 
void call (uint32 offset)
 
void writeByte (int32 offset, byte v)
 
uint8 getVersionMajor () const
 
uint8 getVersionMinor () const
 
uint32 getVariablesCount () const
 
uint32 getTextsOffset () const
 
uint32 getResourcesOffset () const
 
uint16 getAnimDataSize () const
 
uint8 getImFileNumber () const
 
uint8 getExFileNumber () const
 
uint8 getCommunHandling () const
 
uint16 getFunctionOffset (uint8 function) const
 

Static Public Member Functions

static uint32 getVariablesCount (const char *fileName, GobEngine *vm)
 

Member Function Documentation

◆ read()

uint32 Gob::Script::read ( byte *  data,
int32  size 
)

Read data and move the pointer accordingly.

◆ peek()

uint32 Gob::Script::peek ( byte *  data,
int32  size,
int32  offset = 0 
) const

Read data (from an optional offset) without moving the pointer.

◆ getOffset()

int32 Gob::Script::getOffset ( byte *  ptr) const

Returns the offset the specified pointer is within the script data.

◆ getData() [1/2]

byte* Gob::Script::getData ( int32  offset) const

Returns the data pointer to the offset.

◆ getData() [2/2]

byte* Gob::Script::getData ( )

Returns the raw data pointer.

◆ load()

bool Gob::Script::load ( const Common::String fileName)

Load a script file.

◆ unload()

void Gob::Script::unload ( )

Unload the script.

◆ isLoaded()

bool Gob::Script::isLoaded ( ) const

Was a script loaded?

◆ setFinished()

void Gob::Script::setFinished ( bool  finished)

Setting the 'finished' property.

◆ isFinished()

bool Gob::Script::isFinished ( ) const

Querying the 'finished' property.

◆ push()

void Gob::Script::push ( )

Push the current script position onto the call stack.

◆ pop()

void Gob::Script::pop ( bool  ret = true)

Pop a script position from the call stack (and return there).

◆ call()

void Gob::Script::call ( uint32  offset)

Push the current script position and branch to the specified offset.

◆ writeByte()

void Gob::Script::writeByte ( int32  offset,
byte  v 
)

Override a byte into the loaded script data (used for some script bugs workarounds)


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