Ultima 9 Bitmap*.flx file format ================================ Revision 1.00 7th Jan 2002 Bitmap16.flx contains 16 bit bitmaps, Bitmapsh.flx contains 8 bit bitmaps, bitmapc.flx contains compressed bitmaps. Header ------ Offset Size Description 0 WORD width (individual frames may change this) 2 WORD number of mipmaps 4 WORD height (once again, frames may change) 6 WORD 0 8 DWORD number of frames (f) C 3 ?? (u1) Contains two 4bit entries a and b: related to the width and height (2^a=width, 2^b=height) F 1 f-1 10 8*f offset and size of each frame : DWORD : offset from beginning of file DWORD : size in bytes Frame Format ------------ Offset Size Description 0 DWORD ?? (u2) 4 DWORD width of frame 8 DWORD height of frame C DWORD ?? (u3) Onlys fonts and cursor graphics have data here 10 DWORD ?? (u4) Once again, only fonts and cursor use this 14 4*height Offsets to each scanline of the bitmap (useful for calculating the depth of the image, since it isn't given anywhere else [you can't even rely on the filename, since there are some 16 bit images in the 8 bit flx file :) ]) . W*H*D bitmap data (goes in horizontal scanlines, from top to bottom) . x mipmaps (*) * the number of mipmaps is defined in the header. Each mipmap has half the width and half the height of the last... So if you have a frame with a width of 0x80, a height of 0x80, and 5 mipmaps, you'll start off with the actual data for the frame, followed by the mipmaps : 1st mipmap : height 0x40, width 0x40 2nd mipmap : height 0x20, width 0x20 3rd mipmap : height 0x10, width 0x10 4th mipmap : height 0x8, width 0x8 5th mipmap : height 0x4, width 0x4 Then the frame data ends. Written by John Larcombe aka TumbleWeed Dragon tumble_weed@hotmail.com http://www.iinet.net.au/~larcombe