GETileAtlas

Maps block type IDs to UV rects in object-m.png via Easy3D::TextureAtlas.

Overview

Wraps an Easy3D::TextureAtlas sized to the sheet dimensions kSheetW × kSheetH = 1301 × 1431 (object-m.png), registered as one grid via AddGrid with kTileSize = 64, kSheetCols = 20, and kSheetGap = 1 (65 px pitch: 64 px icon + 1 px inter-tile gap — confirmed against mobile-eggbert's Pixmap::GetSrcRectangle).

Sources: src/GalaxyEggbertCNA/Game/GETileAtlas.hpp and .cpp.

API

class GETileAtlas {
public:
    explicit GETileAtlas(int textureWidth, int textureHeight);
    Easy3D::UvRect GetTileUv(uint16_t blockType) const;
};

GetTileUv(blockType)

Returns an all-zero UvRect for blockType <= 0 (Air); otherwise looks up "tile_<blockType>" in the atlas. BlockTypes::tileUV() (in BlockTypes.hpp) independently computes the same rect with a half-pixel inset to avoid seam bleeding, and is cross-checked against this class.

Bug fixed 2026-07-04 The atlas grid registration originally assumed a flat 64 px pitch with no inter-tile gap; accounting for the sheet's real 65 px pitch (1 px gap) fixed visible seam artifacts.

Dependencies

Easy3D::TextureAtlas only.