11-03-2022, 03:35 AM
Hi,
I've just pushed release 2.13 o GitHub that implements per-tile palette like in classic 2D chipsets. Up to 8 global palettes can be set with TLN_SetGlobalPalette(). Tile palette index is set in Tile.palette property.
By default global palettes are unset (NULL) and all tiles use palette 0. Having corresponding global palette set to NULL makes the renderer pick the tileset's own palette like before, so it doesn't break compatibility. Only when palette selector bits in Tile struct point to a not-NULL global palette, is picked over tileset's default palette.
https://github.com/megamarc/Tilengine/co...0cd570f381
I've just pushed release 2.13 o GitHub that implements per-tile palette like in classic 2D chipsets. Up to 8 global palettes can be set with TLN_SetGlobalPalette(). Tile palette index is set in Tile.palette property.
By default global palettes are unset (NULL) and all tiles use palette 0. Having corresponding global palette set to NULL makes the renderer pick the tileset's own palette like before, so it doesn't break compatibility. Only when palette selector bits in Tile struct point to a not-NULL global palette, is picked over tileset's default palette.
https://github.com/megamarc/Tilengine/co...0cd570f381