10-29-2022, 07:44 PM
Hi! Thanks for your suggestion.
However, it's not recommended to modify linked resources that have been loaded recursively. For example when you load a tileset or a bitmap, a palette is also loaded/created as a child reference, and the parent resource "owns" the palette, When you destroy the tileset or bitmap, its palette is also destroyed. If not, there would be a memory leak. If you change the palette of a bitmap or tileset, and then destroy the parent resource, the engine will destroy the wrong palette and leave the original palette "orphaned" and leaked. That's why is not a good idea to modify their palettes, instead, set the layer palette with TLN_SetLayerPalette()
This alwo happens with tilesets that are loaded and owned by a particular tilemap.
However, it's not recommended to modify linked resources that have been loaded recursively. For example when you load a tileset or a bitmap, a palette is also loaded/created as a child reference, and the parent resource "owns" the palette, When you destroy the tileset or bitmap, its palette is also destroyed. If not, there would be a memory leak. If you change the palette of a bitmap or tileset, and then destroy the parent resource, the engine will destroy the wrong palette and leave the original palette "orphaned" and leaked. That's why is not a good idea to modify their palettes, instead, set the layer palette with TLN_SetLayerPalette()
This alwo happens with tilesets that are loaded and owned by a particular tilemap.