This is the format used by Jazz Jackrabbit 2 tilesets.
The data sections are compressed with zlib.
struct TILE_Header { char Copyright[ 180]; char Magic[ 4] = "TILE"; long Signature = 0xAFBEADDE char Title[ 32]; short Version; //0x200 for v1.23 and below, 0x201 for v1.24 long FileSize; long CRC32; long CData1; //compressed size of Data1 long UData1; //uncompressed size of Data1 long CData2; //compressed size of Data2 long UData2; //uncompressed size of Data2 long CData3; //compressed size of Data3 long UData3; //uncompressed size of Data3 long CData4; //compressed size of Data4 long UData4; //uncompressed size of Data4 }
If the set is from 1.23 or 1.10o/Battery Check, then MAX_TILES is 1024 and the size of the buffer is 27652. If it’s from 1.24 or A Gigantic Adventure, then MAX_TILES is 4096 and the size of the buffer is 107524.
struct TilesetInfo { long PaletteColor[ 256]; //arranged RGBA long TileCount; //number of tiles, always a multiple of 10 char FullyOpaque[MAX_TILES]; //1 if no transparency at all, otherwise 0 char Unknown1[MAX_TILES]; //appears to be all zeros long ImageAddress[MAX_TILES]; long Unknown2[MAX_TILES]; //appears to be all zeros long TMaskAddress[MAX_TILES]; //Transparency masking, for bitblt long Unknown3[MAX_TILES]; //appears to be all zeros long MaskAddress[MAX_TILES]; //Clipping or tile mask long FMaskAddress[MAX_TILES]; //flipped version of the above }
The Address fields refer to the address or offset in their corresponding buffers from which to start reading.
Specifically, ImageAddress reads from Data2, TMaskAddress reads from Data3, MaskAddress and FMaskAddress reads from Data4, and you should probably memorise this to avoid confusion later on. If you are planning to make a tileset extractor of some sort, you would probably need only to use ImageAddress and MaskAddress.
Each image is 1024 bytes long, uncompressed. Each byte represents a palette index, so you have a 32*32 picture just by reading each byte as a pixel. Note that each image here is unique, so for example if your tileset has a blank space in say, tile #42, then ImageAddress[ 42] will be equal to zero (offset zero in the Data2 buffer).
This is arranged in the same way as Data3.
Edit: It’s similar, but not exact same.
Similar to Data2, except each mask is 128 bytes. This is because the mask is only 1 bit-per-pixel (black or white). If you are trying to extract mask information into a picture for the first time, expect some problems with bit orders; I can’t remember whether it reads MSB-first or LSB-first.
Remember that Data2 is not equivalent to the actual tileset graphics as seen in JCS, and Data4 is not the mask either. Data2 simply contains an image of each unique tile in the set, likewise with Data4. You must read Data1 if you want to find out exactly what image and mask a particular tile# has.
Jazz2Online © 1999-INFINITY (Site Credits). We have a Privacy Policy. Jazz Jackrabbit, Jazz Jackrabbit 2, Jazz Jackrabbit Advance and all related trademarks and media are ™ and © Epic Games. Lori Jackrabbit is © Dean Dodrill. J2O development powered by Loops of Fury and Chemical Beats.
Eat your lima beans, Johnny.