pub struct EmbeddedImage<'a> {
pub slot: u32,
pub bytes: &'a [u8],
}Expand description
One atlas an embedded .ssab carries, still in the form the exporter wrote
it: encoded image bytes (PNG), not pixels.
This is the parsing half of embedded support, and it deliberately has no
decoder behind it — which is why it is available without the embedded
feature. A host with a decoder
already — a browser, or an engine’s asset pipeline — wants this;
SSPack::decode_embedded is for hosts that would rather the player do it.
The bytes borrow the pack’s .ssab, so nothing is copied to produce them.
Fields§
§slot: u32The cellmap’s name_hash — what DrawBatch.texture_hash carries.
A slot inside this pack, not an identity for the image: hand it to
crate::SSPlayer::texture_key for what crate::SSRenderer is keyed
by. The two differ whenever two packs could name one atlas alike, which
a tool that names every project’s atlas spritemap1.png does.
bytes: &'a [u8]The encoded image exactly as the exporter embedded it.