ScummVM API documentation
TwinE::Grid Class Reference

Public Member Functions

 Grid (TwinEEngine *engine)
 
void init (int32 w, int32 h)
 
const uint8 * getBlockBufferGround (const IVec3 &pos, int32 &ground)
 
void drawOverBrick (int32 x, int32 y, int32 z)
 
void drawOverBrick3 (int32 x, int32 y, int32 z)
 
void getSpriteSize (int32 offset, int32 *width, int32 *height, const uint8 *spritePtr)
 
void centerScreenOnActor ()
 
void centerOnActor (const ActorStruct *actor)
 
bool drawBrick (int32 index, int32 posX, int32 posY)
 
bool drawSprite (int32 index, int32 posX, int32 posY, const uint8 *spritePtr)
 
bool drawSprite (int32 posX, int32 posY, const SpriteData &ptr, int spriteIndex=0)
 
bool drawBrickSprite (int32 posX, int32 posY, const uint8 *spritePtr, bool isSprite)
 
const BlockDatagetBlockLibrary (int32 blockIdx) const
 
const BlockDataEntrygetAdrBlock (int32 blockIdx, int32 tmpBrickIdx) const
 
void copyMapToCube ()
 
bool initGrid (int32 index)
 
bool initCellingGrid (int32 index)
 
void redrawGrid ()
 
ShapeType worldColBrick (int32 x, int32 y, int32 z)
 
ShapeType worldColBrickFull (int32 x, int32 y, int32 z, int32 y2, int32 actorIdx)
 
uint8 worldCodeBrick (int32 x, int32 y, int32 z)
 
ShapeType worldColBrick (const IVec3 &pos)
 
ShapeType worldColBrickFull (const IVec3 &pos, int32 y2, int32 actorIdx)
 

Public Attributes

IVec3 _startCube
 
IVec3 _worldCube
 
int16 _zoneGrm = 0
 
int16 _indexGrm = 0
 

Member Function Documentation

◆ getBlockBufferGround()

const uint8* TwinE::Grid::getBlockBufferGround ( const IVec3 pos,
int32 &  ground 
)

search down until either ground is found or lower border of the cube is reached

◆ drawOverBrick()

void TwinE::Grid::drawOverBrick ( int32  x,
int32  y,
int32  z 
)

Draw 3D actor over bricks

Parameters
xactor.x coordinate
yactor.y coordinate
zactor.z coordinate

◆ drawOverBrick3()

void TwinE::Grid::drawOverBrick3 ( int32  x,
int32  y,
int32  z 
)

Draw sprite actor over bricks

Parameters
xactor.x coordinate
yactor.y coordinate
zactor.z coordinate

◆ getSpriteSize()

void TwinE::Grid::getSpriteSize ( int32  offset,
int32 *  width,
int32 *  height,
const uint8 *  spritePtr 
)

Get sprite width and height sizes

Parameters
offsetsprite pointer offset
widthsprite width size
heightsprite height size
spritePtrsprite buffer pointer

◆ centerScreenOnActor()

void TwinE::Grid::centerScreenOnActor ( )

recenter screen on followed actor automatically

◆ drawBrick()

bool TwinE::Grid::drawBrick ( int32  index,
int32  posX,
int32  posY 
)

Draw brick sprite in the screen

Parameters
indexbrick index to draw
posXbrick X position to draw
posYbrick Y position to draw

◆ drawSprite()

bool TwinE::Grid::drawSprite ( int32  index,
int32  posX,
int32  posY,
const uint8 *  spritePtr 
)

Draw sprite in the screen

Parameters
indexsprite index to draw
posXsprite X position to draw
posYsprite Y position to draw
ptrsprite buffer pointer to draw

◆ drawBrickSprite()

bool TwinE::Grid::drawBrickSprite ( int32  posX,
int32  posY,
const uint8 *  spritePtr,
bool  isSprite 
)

Draw sprite or bricks in the screen according with the type

Parameters
posXsprite X position to draw
posYsprite Y position to draw
ptrsprite buffer pointer to draw
isSpriteallows to identify if the sprite to display is brick or a single sprite

◆ getBlockLibrary()

const BlockData* TwinE::Grid::getBlockLibrary ( int32  blockIdx) const

Get block library

Parameters
blockIdxblock library index
Returns
pointer to the current block index

◆ copyMapToCube()

void TwinE::Grid::copyMapToCube ( )

Create grid map from current grid to block library buffer

◆ initGrid()

bool TwinE::Grid::initGrid ( int32  index)

Initialize grid (background scenearios)

Parameters
indexgrid index number

◆ initCellingGrid()

bool TwinE::Grid::initCellingGrid ( int32  index)

Initialize celling grid (background scenearios)

Parameters
indexgrid index number

◆ redrawGrid()

void TwinE::Grid::redrawGrid ( )

Redraw grid background

Member Data Documentation

◆ _startCube

IVec3 TwinE::Grid::_startCube

New grid camera x, y and z coordinates

◆ _worldCube

IVec3 TwinE::Grid::_worldCube

Current grid camera x, y and z coordinates

◆ _zoneGrm

int16 TwinE::Grid::_zoneGrm = 0

Flag to know if the engine is using celling grids

◆ _indexGrm

int16 TwinE::Grid::_indexGrm = 0

Current celling grid index


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