Welcome to the Creatures Wiki! Log in and join the community.

BLK files

From Creatures Wiki
Revision as of 16:21, 8 February 2005 by Bdonlan (talk) (recategorize)
Jump to navigation Jump to search

BLK files are basically S16 files with a slightly different header, and with slightly incorrect offsets due to the different header. They contain 128x128 sprites which are the 'blocks' which make up the background.

The header is as follows (all values are little-endian):

flags32-bit integeronly the first bit is used; if set, the image is in 555 format, if not, the image is in 565 format
backgroundwidth16-bit integerthe width of the background, in blocks (not pixels!)
backgroundheight16-bit integerthe height of the background, in blocks (not pixels!)
numframes16-bit integerthe number of sprites in the file (must always equal backgroundwidth * backgroundheight)

Then, for each sprite:

offset32-bit integeroffset of the sprite data from the start of the file, minus 4.
width16-bit integerwidth of the sprite. must be 128.
height16-bit integerheight of the sprite. must be 128.

The rest of the file consists of 16-bit image data at the file offsets defined in the header.