Difference between revisions of "SAGA/Datafiles/SAGA RLE2"
Jump to navigation
Jump to search
(Added resource page) |
(Added a link to the sprite list resources page) |
||
Line 1: | Line 1: | ||
== SAGA_RLE2 Compression Format == | == SAGA_RLE2 Compression Format == | ||
The SAGA_RLE2 compression format is used in Sprite List | The SAGA_RLE2 compression format is used in [[SAGA/Datafiles/Sprite List|Sprite List Resources]].<br> | ||
The SAGA_RLE2 compression format uses a two-byte RLE marker: | The SAGA_RLE2 compression format uses a two-byte RLE marker: | ||
Latest revision as of 09:33, 9 November 2007
SAGA_RLE2 Compression Format
The SAGA_RLE2 compression format is used in Sprite List Resources.
The SAGA_RLE2 compression format uses a two-byte RLE marker:
Type | Order | Name | Description |
INT16 | . | bg_runcount | Background runcount |
INT16 | . | fg_runcount | Foreground runcount |
The "background" of Sprite List data is the value 0x00, and is transparent.
To decode an SAGA_RLE2 resource:
1. Read in RLE marker 2. Write 0x00 to output [bg_runcount] times. ( Skip for transparency ) 3. Write [fg_runcount] bytes from encoded stream to output. ( Skip bytes of 0x00 for transparency ) 4. Read in the next RLE marker 5. Repeat until end of input stream
The end of the encoded stream appears to be a single 0x00 byte.