sgdk
|
MapDefinition structure which contains data for large level background.
It's optimized to encode large map using 128x128 block chunk (block chunk are organized in metatile).
More...
#include <map.h>
Public Attributes | |
u16 | w |
u16 | h |
u16 | hp |
u16 | compression |
u16 | numMetaTile |
u16 | numBlock |
Palette * | palette |
TileSet * | tileset |
u16 * | metaTiles |
void * | blocks |
void * | blockIndexes |
u16 * | blockRowOffsets |
MapDefinition structure which contains data for large level background.
It's optimized to encode large map using 128x128 block chunk (block chunk are organized in metatile).
w | map width in block (128x128 pixels block). |
h | map height in block (128x128 pixels block). |
hp | map height in block (128x128 pixels block) removing duplicated rows |
compression | b0-b3=compression type for metaTiles b4-b7=compression for blocks data b8-b11=compression for blockIndexes data Accepted values: COMPRESSION_NONE COMPRESSION_APLIB COMPRESSION_LZ4W |
numMetaTile | number of MetaTile |
numBlock | number of Block (128x128 pixels chunk) |
palette | Palette data. |
tileset | TileSet data structure (contains tiles definition for the image). |
metaTiles | metatiles definition, each metatile is encoded as 2x2 tiles block:
|
blocks | blocks definition, each block is encoded as 8x8 metatiles: if numMetaTile <= 256 --> 8 bit index for metaTile else --> 16 bit index for metaTile |
blockIndexes | block index array (referencing blocks) for the w * hp sized map if numBlock <= 256 --> 8 bit index for block else --> 16 bit index for block |
blockRowOffsets | block row offsets used internally for fast retrieval of block data (index = blockIndexes[blockRowOffsets[y] + x]) |