Module ryot::sprites

source ·

Re-exports§

Modules§

Structs§

Enums§

Functions§

  • Creates a sprite sheet image from a given CIP decompressed bmp and saves it to the given output path. The sprite sheet is expected to have 384x384 pixels and 4 channels (RGBA). The data is expected to be in the BGRA format. The data is expected to be flipped vertically. The data is expected to have a 122 byte header that we need to skip
  • CIP’s sprite sheets have a 32 byte header that contains the following information: [0..X] - Variable number of place holder NULL (0x00) bytes. X varies according to the sheet decompressed size. [X..X+5] - 5 bytes with the constant byte sequence [0x70 0x0A 0xFA 0x80 0x24]. [X+6..32] - LZMA file size encoded as a 7-bit integer, can occupy 2 or 3 bytes, depending on the number represented.
  • Decompress and save the plain sprite sheets to the given destination path. This is used to generate a decompressed cache of the sprite sheets, to optimize reading. Trade off here is that we use way more disk space in pro of faster sprite loading.