Welcome to the Creatures Wiki! Log in and join the community.
Difference between revisions of "BLK files"
Jump to navigation
Jump to search
GreenReaper (talk | contribs) m |
(move 555/565 info elsewhere) |
||
Line 1: | Line 1: | ||
− | [[BLK files]] are basically [[S16 files]] with a slightly different header, and with slightly incorrect offsets due to the different header. They contain 128x128 | + | [[BLK files]] are basically [[S16 files]] with a slightly different header, and with slightly incorrect offsets due to the different header. They contain 128x128 [[sprite]]s which are the 'blocks' which make up the background. |
The header is as follows (all values are little-endian): | The header is as follows (all values are little-endian): | ||
<table border="1"> | <table border="1"> | ||
− | <tr><td>flags</td><td>32-bit integer</td><td>only the first bit is used; if set, the image is in 555 format, if not, the image is in 565 format</td></tr> | + | <tr><td>flags</td><td>32-bit integer</td><td>only the first bit is used; if set, the image is in [[555/565|555]] format, if not, the image is in [[555/565|565]] format</td></tr> |
<tr><td>backgroundwidth</td><td>16-bit integer</td><td>the width of the background, in blocks (not pixels!)</td></tr> | <tr><td>backgroundwidth</td><td>16-bit integer</td><td>the width of the background, in blocks (not pixels!)</td></tr> | ||
<tr><td>backgroundheight</td><td>16-bit integer</td><td>the height of the background, in blocks (not pixels!)</td></tr> | <tr><td>backgroundheight</td><td>16-bit integer</td><td>the height of the background, in blocks (not pixels!)</td></tr> | ||
Line 18: | Line 18: | ||
</table> | </table> | ||
− | The rest of the file consists of image data at the file offsets defined in the header. Images are stored as an array of horizontal scanlines. Each pixel is represented as a 16-bit little-endian integer | + | The rest of the file consists of image data at the file offsets defined in the header. Images are stored as an array of horizontal scanlines. Each pixel is represented as a 16-bit little-endian integer in the format specified in the header. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:File formats]] | [[Category:File formats]] |
Revision as of 00:50, 16 February 2005
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):
flags | 32-bit integer | only the first bit is used; if set, the image is in 555 format, if not, the image is in 565 format |
backgroundwidth | 16-bit integer | the width of the background, in blocks (not pixels!) |
backgroundheight | 16-bit integer | the height of the background, in blocks (not pixels!) |
numframes | 16-bit integer | the number of sprites in the file (must always equal backgroundwidth * backgroundheight) |
Then, for each sprite:
offset | 32-bit integer | offset of the sprite data from the start of the file, minus 4. |
width | 16-bit integer | width of the sprite. must be 128. |
height | 16-bit integer | height of the sprite. must be 128. |
The rest of the file consists of image data at the file offsets defined in the header. Images are stored as an array of horizontal scanlines. Each pixel is represented as a 16-bit little-endian integer in the format specified in the header.