IMG Format (Meen)

From ModdingWiki
Jump to: navigation, search
IMG Format (Meen)
File:IMG Format (Meen).png
There is no image of a tileset in this format — upload one!
Format typeTileset
HardwareVGA
Max tile count131,072
PaletteExternal
Tile names?Unknown
Minimum tile size (pixels)Unknown
Maximum tile size (pixels)Unknown
Plane count1
Plane arrangementLinear
Transparent pixels?Unknown
Hitmap pixels?No
Metadata?Unknown
Supports sub-tilesets?No
Compressed tiles?No
Hidden data?No
Games

! Document how masking works

The IMG format is used by Animation Magic's Meen engine games for a level's textures and sprites. Images are in raw 8-bit (256 colours) and the palette from game_scr.pcx is used by both games.

Header

V1

These are the IMG files used by I.M.Meen, they consist purely of 64x64 entries that are rotated 90 degrees counter-clockwise.

Data type Description
UINT16LE Index start 01 for SKY and FLOOR indicates no jump and listing will occur after # of unmasked textures. Any number above 01 will be given +10 in hex, so 0E will become 1E(30 bytes/0x1E) indicating the location of the starting pointer index.
UINT16LE Textures Number of unmasked textures.
UINT16LE Switches Number of switch/interactive textures.
UINT16LE Masked If Index Start is not 01, then this will be the number of masked entries.
UINT16LE Switches A repeat entry.

The pointer index follows this structure:

Data type Description
UINT32LE Pointer Always starting with 00 10 00 00. Entry afterwards indicates end and beginning of next.

Info on the masked/compressed textures can be found in the tools section as a fully functioning converter exists for I.M. Meen IMG files.

V2

Those used by Chill Manor. They can consist of multiple-dimensional entries and have mipmaps. They are mostly the same as the ones in I.M.Meen with the exception that each graphic entry has its own sub-index for the mipmap entries. The format is the same as the main index with the next entry being the end of one and the start of another. They count WITHIN the entry, not throughout the IMG file, so exact hex coordinates would be the start point + the hex location of the beginning header.

Data type Description
UINT32LE Start point How many bytes to jump ahead to where the graphic starts.
UINT32LE End Point How many bytes to jump ahead to reach the end of the graphic.
UINT32LE End Point of mip 1 How many bytes to jump ahead to reach the end of the first mipmap.
UINT32LE End Point of mip 2 How many bytes to jump ahead to reach the end of the second mipmap.
UINT32LE End Point of mip 3 How many bytes to jump ahead to reach the end of the third mipmap.
UINT32LE End Point of mip 4 How many bytes to jump ahead to reach the end of the fourth mipmap.
UINT32LE End Point of mip 5 How many bytes to jump ahead to reach the end of the final mipmap.

The handling of transparency is the same, regardless. With the existing tool, theoretically, one could manually cut out an entry in the IMAGES file, apply a working IMG header and parse it through as a miniature IMG file but it still only handles 64x64 currently.

Source

This information comes from personal experience and from this thread which also contains the tool IMG2BMP by WRS who has provided source code in Delphi.