ScummVM API documentation
MutationOfJB::Object Struct Reference

#include <gamedata.h>

Inheritance diagram for MutationOfJB::Object:
Common::Serializable

Public Member Functions

bool loadInitialState (Common::ReadStream &stream)
 
void saveLoadWithSerializer (Common::Serializer &sz) override
 

Public Attributes

uint8 _active
 
uint8 _firstFrame
 
uint8 _randomFrame
 
uint8 _numFrames
 
uint8 _roomFrameLSB
 
uint8 _jumpChance
 
uint8 _currentFrame
 
uint16 _x
 
uint8 _y
 
uint16 _width
 
uint8 _height
 
uint16 _WX
 
uint8 _roomFrameMSB
 
uint8 _SP
 

Detailed Description

An animated image in the scene.

Object frames consist of surfaces carved out of room frames (starting from _roomFrame up until _roomFrame + _numFrames - 1) based on the object's rectangle. They are stored in the shared object frame space that each object occupies a continous part of from the beginning.

By using the term "frame" alone we will be referring to an object frame, not a room frame.

For details regarding animation playback, see objectanimationtask.cpp.

Member Function Documentation

◆ loadInitialState()

bool MutationOfJB::Object::loadInitialState ( Common::ReadStream stream)

Load initial state from game data file.

Parameters
streamStream for reading.
Returns
True if success, false otherwise.

◆ saveLoadWithSerializer()

void MutationOfJB::Object::saveLoadWithSerializer ( Common::Serializer sz)
overridevirtual

(De)serialization for save/load.

Parameters
szSerializer.

Implements Common::Serializable.

Member Data Documentation

◆ _active

uint8 MutationOfJB::Object::_active

Controls whether the animation is playing.

◆ _firstFrame

uint8 MutationOfJB::Object::_firstFrame

Number of the first frame this object has in the shared object frame space (FA register).

For the first object, it is equal to 1. For any subsequent object, it is equal to (_firstFrame + _numFrames) of the previous object.

Note
The numbering starts from 1.
Technically this field is useless because it can be calculated.

◆ _randomFrame

uint8 MutationOfJB::Object::_randomFrame

The frame that is jumped to randomly based on _jumpChance (FR register).

Note
Numbered from 1 and relative to _firstFrame.
A value of 0 disables randomness completely.
See also
objectanimationtask.cpp
_jumpChance

◆ _numFrames

uint8 MutationOfJB::Object::_numFrames

Number of animation frames (NA register).

◆ _roomFrameLSB

uint8 MutationOfJB::Object::_roomFrameLSB

Low 8 bits of the 16-bit starting room frame (FS register). This is in the room frame space.

See also
_roomFrameMSB

◆ _jumpChance

uint8 MutationOfJB::Object::_jumpChance

Chance (1 in x) of the animation jumping to _randomFrame.

See also
objectanimationtask.cpp

◆ _currentFrame

uint8 MutationOfJB::Object::_currentFrame

Current animation frame (CA register).

Note
Index in the shared object frame space. Numbered from 1.

◆ _x

uint16 MutationOfJB::Object::_x

X coordinate of the object rectangle (XX register).

◆ _y

uint8 MutationOfJB::Object::_y

Y coordinate of the object rectangle (YY register).

◆ _width

uint16 MutationOfJB::Object::_width

Width of the object rectangle (XL register).

◆ _height

uint8 MutationOfJB::Object::_height

Height of the object rectangle (YL register).

◆ _WX

uint16 MutationOfJB::Object::_WX

A general-purpose register for use in scripts. Nothing to do with animation.

◆ _roomFrameMSB

uint8 MutationOfJB::Object::_roomFrameMSB

High 8 bits of the 16-bit starting room frame (WY register). This is in the room frame space.

See also
_roomFrameLSB

◆ _SP

uint8 MutationOfJB::Object::_SP

Unknown. TODO: Figure out what this does.


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