TIS is, no doubt, short for tileset, since that is what these files essentially are. TIS files are comprised of a (typically) large number of tiles, which are, themselves, composed of a palette and a rectangular block of pixels, which are indices into the associated palette. Each tile has its own palette and a block of pixels. The pixel data is not at all compressed.
A tileset doesn't mean much on its own, since the tile locations are specified in another file (the .WED file). The layout of a tile is as follows. First,
there is a 256-color palette. Each palette entry is a Windows RGBQUAD structure, which means that each palette entry is 4-bytes long, and that the layout
in memory is B, G, R, a. The a is probably flags, since that is what the extra byte is used
for in the Win32 API. It could be alpha, but alpha transparency is not used in BG. In either case, it is immaterial, since it doesn't appear to be used
anywhere. Immediately following that, there are 8-bit pixel values, which are indices into this palette. The pixel values come one after another, row by row,
from left to right and top to bottom. Index 0 is hardcoded to be the transparent index. (I think; however, I had previously believed this to be true of the
BAM file format, and found myself to be quite mistaken, so...) I also believe all tilesets are composed of 64x64 tiles; it is possible that the size is actually
stored in some other file. (The WED file comes to mind...)
[ back to index ]