TileSetData struct
#include <Jazz2/Formats/TileSetFile.h>
A whole tile set as its file stores it.
Each tile is either an 8-bit one, whose pixels are palette indices (0 is transparent), or a true color one, whose pixels are RGBA. Both keep their pixels in a 4096-byte slot of Images, an 8-bit tile in the first 1024 bytes of it.
Public static variables
-
static std::
int32_t ImageBytesPerTile constexpr - Bytes of the pixels of a tile.
-
static std::
int32_t MaskBytesPerTile constexpr - Bytes of the collision mask of a tile.
Public functions
-
void Resize(std::
int32_t tileCount) - Resizes the tile set, the new tiles are empty.
- auto HasTrueColorTiles() const -> bool
- Returns
trueif any tile is a true color one.
Public variables
-
std::
uint32_t Palette - Palette as
R | G << 8 | B << 16 | A << 24, entry 0 is transparent. -
std::
int32_t TileCount - Number of tiles.
-
SmallVector<std::
uint8_t, 0> Images - Pixels of all tiles, ImageBytesPerTile each.
-
SmallVector<std::
uint8_t, 0> TrueColor - Non-zero for a true color tile, one byte per tile.
-
SmallVector<std::
uint8_t, 0> Masks - Collision masks of all tiles, 1 bit per pixel (LSB-first, row by row), MaskBytesPerTile each.
-
std::
int32_t Columns - Tiles per row of the image content, zero to choose the one that wastes the least texture memory.