08-10-2022, 03:28 PM
To fully support per-tile palette, you should modify DrawLayerScanline(), DrawLayerScanlineScaling(), DrawLayerScanlineAffine() and DrawLayerScanlinePixelMapping(). Each one is responsible of the different "graphic modes": standard, scaling, affine transformations and pixel mapping.
I'd also implement the following functions:
As you can see, tiles belong to tilemaps, not to layers.
I'd also implement the following functions:
Code:
// Get pointer to one of slotted palettes:
TLN_Palette TLN_GetSlottedPalette(int index);
// Set slotted palette to specific tile:
void TLN_SetTilePalette(TLN_Tilemap tilemap, int row, int column, int index);
// Remove tile palette (use default one)
void TLN_DisableTilePalette(TLN_Tilemap tilemap, int row, int column);
As you can see, tiles belong to tilemaps, not to layers.