Wednesday, May 27, 2015

Gash - Sprite Extraction

Today I wrote two important routines for the NextGenGraphics class in FleexCore: one to transform raw decompressed chunk data into a 2D array of pixels representing color, and another to transform that array into an instance of LowColorBitmap.

The EGA (planes shuffled) version of these functions is working perfectly. After writing the getter for the Sprite property on NextGenGraphics and throwing together a quick test program, I am able to dump out all the sprites of Keen 4 into a collection of transparent PNGs:


The CGA and VGA (normal bit arrangement) version of these functions is not working so well. Even when I finally figured out exactly where the offset table (header) and Huffman dictionary is in the CGA version of Keen 4, I'm just getting garbled versions of the sprites:


It looks like the mask is actually after all the color data, not interleaved with it like I assumed. There's also some sort of horizontal duplication and overall squishing going on, but I'm not sure what's causing that.

No comments:

Post a Comment