h08 is number of mipmaps.
0x200 x 0x200 = 0 0x20000 DXT1 size
0x100 x 0x100 = 1 0x8000 DXT1 size
0x080 x 0x080 = 2 0x2000 DXT1 size
0x040 x 0x040 = 3 0x800 DXT1 size
0x020 x 0x020 = 4 0x200 DXT1 size
0x010 x 0x010 = 5 0x080 DXT1 size
0x008 x 0x008 = 6 0x020 DXT1 size
0x004 x 0x004 = 7 0x08 DXT1 size
0x002 x 0x002 = 8 0x08 DXT1 size (anything less than 0x4 x 0x4 always clamp to 4x4)
---------------------------------
total size = 0x2AAB0
what does data in perm.bin file say...
01000000 ... 0002 0002 0800 0100 ... B0AA0200 ...
for another 0x200 by 0x200 image it has
03000000 ... 0002 0002 0800 0100 ...50550500 ...
notice file size is twice as large... probably means DXT5.
so my guess is your h03 is probably type (not file extension has) with 0x0001 being DXT1 and 0x0003 being DXT5.
you have my code ekey... lookup my CreateDXT1Header and CreateDXT5Header in x_dds.h/x_dds.cpp and it will create dds header for you. save to file. paste data from bin file to end of test.dds file. hopefully you see image he he he.
Code: Select all
DDS_HEADER ddsh;
CreateDXT1Header(0x200, 0x200, 8, FALSE, &ddsh);
ofstream ofile("test.dds", ios::binary);
ofile.write("DDS ", 4);
ofile.write((char*)&ddsh, sizeof(ddsh));
