ItsMods

Full Version: IWI Header
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there any way to see what format of DDS is in a IWI file (Like DXT1 or DXT5) ? Well if anyone know please tell me.
Sure,

here is snippet from my code.


Code:
    struct IWIHeader{
        BYTE DTX_Type;
        BYTE flags;
        short x;
        short y;
        short misc;
        int blockoffsets[4];
    };

    struct IWIHeader_MW2{ // mw3 also
        short dunno;
        short dunno1;
        BYTE DTX_Type;
        BYTE flags;
        short x;
        short y;
        short misc;
        int blockoffsets[5];
        int dunno2;
    };

Code:
    enum{
        IWI_ARGB8 = 1,
        IWI_RGB8,
        IWI_DTX1 = 11,
        IWI_DTX3,
        IWI_DTX5
    };
Code:
IWI (Infinity Ward Image) File Format
Length     | Position | Description
---------------------------------
0x3    | 0x0       | Contains the text 'IWi' in ASCII form
0x1    | 0x3       | The version of the IWI 0x5 = COD2, 0x6 = COD4, 0xD = BO (I think), 0x8 = MW2/MW3
0x1    | 0x4       | Unknown, not sure.
0x1    | 0x5       | The flags of the data [If (flags & 0x3) == 0x3, this image has mipmaps]
0x1    | 0x6       | The usage flag. [0x0 = Color image, 0x1 = Skybox collection, 0x4 = Normal Map, 0x09 = Skybox collection (w/ alpha)
0x1    | 0x7       | Unknown, not sure.
0x2    | 0x8       | True format. [0x1 = ARGB8, 0x2 = RGB8, 0x3 = ARGB4, 0x4 = A8, 0x7 = JPG, 0xB = DXT1, 0xC = DXT3, 0xD = DXT5] // Credits to Denton Woods
0x2    | 0xA       | The width of the image (in pixels)
0x2    | 0xC       | The height of the image (in pixels)
0x2    | 0xE       | Unknown, not sure.
0x4    | 0x10      | The file size of the of the file (including header)
0x4    | 0x14      | The offset to the texture
0x4    | 0x18      | Offset to the 1st mipmap
0x4    | 0x1B      | Offset to the 2nd mipmap

Credits to master131, Denton Woods and Matej Tomčík.
Thanks both im just trying to make a iwi fixer/header creator so if the size or resolution of the iwi file is more then the game doesnt crash. What does that mean? well its not much useful, but if developed correctly with this we could do a plugin to create iwi's directly or do a HD texture pack.