nCine::RHI::RDP::TileRecord struct

One tile of a tile-layer mesh in the packed form the RDP dispatch reads.

A tile layer reaches the RDP backend as a mesh of the TileMapMesh effect. Drawn with PrimitiveType::Points, its vertex buffer holds one of these per tile instead of vertices: where the tile goes, and which texels of the atlas chunk it shows - as the integers the RDP takes them as, so the dispatch neither scales normalized coordinates back up nor rounds them onto the texel grid. At 16 bytes it is a quarter of the two 8-float corners a tile took before, which matters on a CPU where every cache line a frame reads costs ~44 cycles.

Every tile is Size pixels and texels square, mapped 1:1 before the view's own scale. The mesh is produced only for this backend (the tile map's grouped emission and its N64 layer cache); every other backend is given ordinary vertices.

Public static variables

static std::int32_t Size constexpr
Width and height of every tile, in pixels and in texels.
static std::uint8_t FlipX constexpr
Horizontal flip, see Flags.
static std::uint8_t FlipY constexpr
Vertical flip, see Flags.

Public variables

float X
Top-left corner of the tile, in the space the command's transformation maps.
float Y
std::uint16_t TexX
Top-left texel of the tile in the atlas chunk the mesh samples.
std::uint16_t TexY
std::uint8_t Alpha
Alpha of the tile (it modulates the layer colour).
std::uint8_t Flags
Combination of FlipX and FlipY.
std::uint16_t Reserved