IMG Format (Meen)
Document how masking works
These are the IMG files used by I.M.Meen, they consist purely of 64x64 entries that are rotated 90 degrees counter-clockwise.
|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:
|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.
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.
|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.
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.