JJ2Anims class
#include <Jazz2/Compatibility/JJ2Anims.h>
Parses original .j2a animation files.
Reads the original game's combined animation archive (Anims.j2a), decoding its animation sets, frames and embedded audio samples, and writes the converted sprites and sounds into the engine's .pak format. Asset naming and palette handling are driven by AnimSetMapping.
Public types
- struct PackedFrame
- Where one frame ends up in a tightly packed sheet.
- struct PackedSheet
- Describes a tightly packed sheet, or nothing when the frames form a regular grid.
Public static functions
- static auto Convert(StringView path, PakWriter& pakWriter, bool isPlus = false) -> JJ2Version
- Converts the specified animation file and writes the result to a
.pakfile. -
static void WriteImageContent(Stream& so,
const std::
uint8_t* data, std:: int32_t width, std:: int32_t height, std:: int32_t channelCount) - Writes raw image content to the specified stream.
-
static void ReadImageContent(Stream& s,
std::
uint8_t* data, std:: int32_t width, std:: int32_t height, std:: int32_t channelCount) - Reads raw image content from the specified stream.
Function documentation
static void Jazz2:: Compatibility:: JJ2Anims:: ReadImageContent(Stream& s,
std:: uint8_t* data,
std:: int32_t width,
std:: int32_t height,
std:: int32_t channelCount)
Reads raw image content from the specified stream.
The counterpart of WriteImageContent, and the only decoder for it - the game reads its sprites, tilesets and fonts through this. data is written channelCount bytes per pixel, but each pixel is stored with a single four byte write, so the buffer needs three bytes of slack past the last pixel when fewer channels are read.