struct { char mptn[4]; // Should always contain "MPTN" uint16_t tiles_number; color_t palette[16]; tile_t tiles[tiles_number]; } mptn_t; struct { uint8_t red, green, blue; } color_t;
A tile is a 16×16 image, with a depth of 16 colors. The data is encoded as four lists of 256 bits (32 bytes), such as for one pixel, the color number is obtained by the addition of the 2-power of the corresponding bit in each list, with the least significant bit being the one from the first list. Each line can be seen as a big-endian short.
struct { short lines1[16][4]; } tile_t;