SpriteRepacker class
Re-lays out the hand-made sprite sheets that a platform would have to split.
The sheets the conversion produces never have a frame lying across a page line (see Compatibility::
Such a sheet is rewritten into the tightly packed form the conversion uses: every frame trimmed to the pixels it actually covers and laid out by Compatibility::
Only multi-frame grids larger than a page are touched. The smaller ones are left as they were authored, because some are sampled as a whole texture rather than frame by frame - the fire and lightning shields scroll across all of theirs - and rewriting them would change what they draw.
Public static functions
- static auto TryRepack(Stream& input, MemoryStream& output, StringView name) -> bool
- Rewrites a grid sheet larger than one page into a tightly packed one.
- static auto TryConvertToLz4(Stream& input, MemoryStream& output, StringView name) -> bool
- Rewrites a sprite sheet with its image content in LZ4.
Function documentation
static bool Jazz2:: AssetPacker:: SpriteRepacker:: TryRepack(Stream& input,
MemoryStream& output,
StringView name)
Rewrites a grid sheet larger than one page into a tightly packed one.
Returns true when the sheet in input was rewritten into output. Otherwise nothing is written and the sheet is to be used as it is - it is not a sprite sheet, it is packed already, it fits into a page or it has a single frame. name is only used in messages.
static bool Jazz2:: AssetPacker:: SpriteRepacker:: TryConvertToLz4(Stream& input,
MemoryStream& output,
StringView name)
Rewrites a sprite sheet with its image content in LZ4.
| Returns | true if output received the sheet, false if it was not recognized (or is LZ4 already) and has to be copied as it is |
|---|
Used for the hand-made sheets of a target whose converted ones are written in LZ4 (see Compatibility::