IWI documentation

Download PDF documentation

You can download the PDF by clicking on the image or this link.

– IWI documentation for IWI files version 8 (Modern Warfare 2, Black Ops, Modern Warfare 3)

– Header structure

– Every header field is described (except for the Unknown fields, note that these fields are specific for the editor and do not affect the IWI file itself)

– Example values and the DXT1 decoder sample (uses external squish for decompressing DXT blocks)

– I will also provide C++ code that you can use to work with IWI files (load multiple formats and compile the directly to the IWI file), below is an example how to load an image and convert it to the IWI file.

using namespace MatejTomcik::IWI;
// Load an image
CImage * img = CImage::FromFile("C:\\input.png");
// Create a content which will hold the image (single or skybox)
CContentSingle * content = new CContentSingle(img, true);
// Create a new IWI file with the content
CIWIFile8 * file = new CIWIFile8(content);
// Set the pixel format (DXT1/3/5,ARGB32,RGB24,L8A8,A8)
file->SetImageFormat(CIWIFile8::ImageFormatDXT1);
// Set the usage (must match the content type, for a single content:
// TextureUsageVisible / TextureUsageAdditive and for a skybox:
// TextureUsageSkybox / TextureUsageSkyboxAlpha
file->SetTextureUsage(CIWIFile8::TextureUsageVisible);
// Save the IWI file
file->Save("C:\\output.iwi");
// Delete the object (note that you don't need to delete images or
// contents that have been assigned to a file
delete file;
Reklamy

Pridaj komentár

Zadajte svoje údaje, alebo kliknite na ikonu pre prihlásenie:

WordPress.com Logo

Na komentovanie používate váš WordPress.com účet. Odhlásiť sa / Zmeniť )

Twitter picture

Na komentovanie používate váš Twitter účet. Odhlásiť sa / Zmeniť )

Facebook photo

Na komentovanie používate váš Facebook účet. Odhlásiť sa / Zmeniť )

Google+ photo

Na komentovanie používate váš Google+ účet. Odhlásiť sa / Zmeniť )

Connecting to %s