Skip to Content
The Alchemy Project

src/field/field_decompress.c

LZ decompression. More…

Included by field.c.

Enumerations

NameDescription
enumanonymous enum { LZ_FLAGS_MARKER, LZ_LENGTH_SHIFT, LZ_DISTANCE_MASK, LZ_LONG_ … }An LZ stream's commands: a byte of eight flags, read from its low bit, each taking one literal byte (1) or one run (0).

Functions

NameDescription
Uint8 *fdDecompressLZ (const Uint8 *src, Uint8 *dest)Decompresses an LZ stream from source into destination and returns destination.

Description

LZ decompression. Part of field.c.

Enumerations in detail

anonymous enum

enum { LZ_FLAGS_MARKER, LZ_LENGTH_SHIFT, LZ_DISTANCE_MASK, LZ_LONG_LENGTH_BASE }

An LZ stream's commands: a byte of eight flags, read from its low bit, each taking one literal byte (1) or one run (0). A run's token is two bytes, high first: the run's length in its top four bits, how far back it copies from in its low twelve.

EnumeratorValueDescription
LZ_FLAGS_MARKER1 << 8set above a flag byte's eight flags
LZ_LENGTH_SHIFT12
LZ_DISTANCE_MASK(1 << LZ_LENGTH_SHIFT) - 1
LZ_LONG_LENGTH_BASE16A run whose length nibble is 0 takes its length from the next byte, plus the lengths the nibble holds.

Definition at line 9 of file field_decompress.c.

Functions in detail

fdDecompressLZ

Uint8 *fdDecompressLZ(const Uint8 *src, Uint8 *dest)

Decompresses an LZ stream from source into destination and returns destination.

References Sint32.

Referenced by fdSpriteComposePicture().

Definition at line 21 of file field_decompress.c.