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 BlockData * | getBlockLibrary (int32 blockIdx) const |
const BlockDataEntry * | getAdrBlock (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 |
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
void TwinE::Grid::drawOverBrick | ( | int32 | x, |
int32 | y, | ||
int32 | z | ||
) |
Draw 3D actor over bricks
x | actor.x coordinate |
y | actor.y coordinate |
z | actor.z coordinate |
void TwinE::Grid::drawOverBrick3 | ( | int32 | x, |
int32 | y, | ||
int32 | z | ||
) |
Draw sprite actor over bricks
x | actor.x coordinate |
y | actor.y coordinate |
z | actor.z coordinate |
void TwinE::Grid::getSpriteSize | ( | int32 | offset, |
int32 * | width, | ||
int32 * | height, | ||
const uint8 * | spritePtr | ||
) |
Get sprite width and height sizes
offset | sprite pointer offset |
width | sprite width size |
height | sprite height size |
spritePtr | sprite buffer pointer |
void TwinE::Grid::centerScreenOnActor | ( | ) |
recenter screen on followed actor automatically
bool TwinE::Grid::drawBrick | ( | int32 | index, |
int32 | posX, | ||
int32 | posY | ||
) |
Draw brick sprite in the screen
index | brick index to draw |
posX | brick X position to draw |
posY | brick Y position to draw |
bool TwinE::Grid::drawSprite | ( | int32 | index, |
int32 | posX, | ||
int32 | posY, | ||
const uint8 * | spritePtr | ||
) |
Draw sprite in the screen
index | sprite index to draw |
posX | sprite X position to draw |
posY | sprite Y position to draw |
ptr | sprite buffer pointer to draw |
bool TwinE::Grid::drawBrickSprite | ( | int32 | posX, |
int32 | posY, | ||
const uint8 * | spritePtr, | ||
bool | isSprite | ||
) |
Draw sprite or bricks in the screen according with the type
posX | sprite X position to draw |
posY | sprite Y position to draw |
ptr | sprite buffer pointer to draw |
isSprite | allows to identify if the sprite to display is brick or a single sprite |
const BlockData* TwinE::Grid::getBlockLibrary | ( | int32 | blockIdx | ) | const |
Get block library
blockIdx | block library index |
void TwinE::Grid::copyMapToCube | ( | ) |
Create grid map from current grid to block library buffer
bool TwinE::Grid::initGrid | ( | int32 | index | ) |
Initialize grid (background scenearios)
index | grid index number |
bool TwinE::Grid::initCellingGrid | ( | int32 | index | ) |
Initialize celling grid (background scenearios)
index | grid index number |
void TwinE::Grid::redrawGrid | ( | ) |
Redraw grid background
IVec3 TwinE::Grid::_startCube |
New grid camera x, y and z coordinates
IVec3 TwinE::Grid::_worldCube |
Current grid camera x, y and z coordinates
int16 TwinE::Grid::_zoneGrm = 0 |
Flag to know if the engine is using celling grids
int16 TwinE::Grid::_indexGrm = 0 |
Current celling grid index