Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support loading sprites from PNG sheets with embedded frame metadata #15336
Implemented a simple loader for PNG based sequences.
The easy Method A:
The complexer but optimized Method B:
Additionaly PaletteFromPng can be used to load a palette from a png file. If your png's share a single palette, you can do this once and reuse it as usual. Otherwise you can load palettes for a single png too, but that requires additional palette rules ofcourse ;)
The core reason is to allow modders to not struggle with Westwood file formats and their restrictions (like 6 bits per color channel palettes) and simply load PNG based assets for mods. Also for modders, this makes their assets visible on GitHub (example: https://github.com/IceReaper/OpenRA/blob/d81998185072eb0e0eb60d3246b3d237b55c1727/mods/cnc/bits/bunny.png ), and allow to use image diff tools in combination with git. So basically: This PR is for mod-friendliness :)
Ideas of future features:
We could use this for the official mods as well and convert https://github.com/OpenRA/OpenRA/tree/bleed/mods/ra/bits to PNG.
About the name of IPaletteLoader - I think this might be a little too close to ILoadsPalettes. Maybe change it to IReadsPalette since the method is ReadPalette(...)?
Otherwise I've merged this into my DR branch and the cursor palette side of things works as advertised.
Syntax of my cursor.yaml is:
Actually this IPaletteLoader is also needed for PaletteFromGimpOrJascFile, but I will make those changes in a separate PR because this one is large enough.