下面是老外论坛的格式资料:
OBJECTS.DAT
byte[4]maybe checksum?
byte[1024]color palette (256 colors)
uint32number of objects
// object index table
for each object {
byte[4]unknown0
uint32offset
}
// actual objects
for each object {
byte[4]unknown0 (same values as before)
uint32width
uint32height
uint32unknown1 (either 8 or 4)
byte[4]unknown2
uint32unknown3
uint32size of section1
<section1>
uint32size of section2
<section2>(not present if size is 0)
uint32size of section3
<section3>(not present if size is 0)
byte[16]always 0
}
<EOF>
// the sections in detail:
<section1>
uint16sprite_width
uint16sprite_height
for (sprite_height) {
if (unknown1 == 8) {
uint16line_offset
} else {
uint32line_offset
}
}
<run-length encoded pixel data>
<num_transparent_pixels><num_opaque_pixels><opaque_pixels[]>
// e.g.
// 55 00 -> 0x55 transparent pixels, no opaque pixels
// 45 01 20 0F 00 -> 0x45 tr., 1 opaque (index: 0x20), 0xF tr.
<section2>
uint16sprite_width
uint16sprite_height
for (sprite_height) {
uint16line_offset
}
<run-length encoded pixel data>
<num_transparent_pixels><num_opaque_pixels>
// e.g.
// 25 07 0A 00 -> 0x25 tr., 7 opaque, 0xA tr.
// = shadow of the object
<section3 (optional)>
// actually it's a headerless MS monochrome bitmap without
// = the collision mask of the object
size of section3:
(sprite_width/8) round up to the next even number
e.g. sprite_width = 85, sprite_height = 80
85 / 8 = 10.625 -> 12 (=line width)
size of section3 = 12*80 = 960