texHeaders.bin File Format: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{unsupported-doc}}
=intro=
TextHeader.bin is created by [[BI_Tools_2.5|Binpbo personal edition 2.5]] and greater.
It is placed in the primary folder of the addon.pbo, and comprises of information from all pax files encountered in that addon from all it's possible data trees.
==Conventions==
see [[Generic FileFormat Data Types]]
=File Structure=
  struct TexHeader.bin
  struct TexHeader.bin
  {
  {
   MimeType "0DHT" ;    // NOT asciiz. '0' = 0x30. This is mimetype "TexHeaDer0"
   MimeType "0DHT" ;    // NOT asciiz. '0' = 0x30. This is mimetype "TexHeaDer0"
   ulong    version;    // 1
   ulong    version;    // 1
   ulong    nTextures; //ce 01 00 00
   ulong    nTextures; //  
   TexBody  TexBodies[nTextures];
   TexBody  TexBodies[nTextures];
  };
  };
 
==TexBody==
 
  TexBody
  TexBody
{
  TexBegin TexBegin;
  Asciiz  *PaaFile;//"data\icons\m4a3_cco_ca.paa"
                    //"fnfal\data\fnfal_smdi.paa"
  TexEnd  TexEnd;
};
* Either BIS have finally learned to use relative file addressing (unlikely), or, more inconsistency for us
where the root is presumed to be \CA\ (or anything else they arbitrarily decide to use).
* It looks like yet-another rule break with lack of ofpec_tags in front of pbo model names, but, it's their game, they can destroy it any way they want to.
TexBegin
  {
  {
   ulong          Always1;
   ulong          Always1;
   ulong          Always0;
   ulong          Always0;
   bgraDecimal    AverageColorDecimal; //AVGCTAGG in PAA (reversed argb format) floating-point equivalent of AverageColorHex;
   floats        AverageColor[r,g,b,a];//[[PAA_File_Format#AVGCTAGG|AVGCTAGG]] floating-point equivalent. Note that order is different
   bgraHex        AverageColorHex; //AVGCTAGG in PAA file (reversed argb format)
   bytes          AverageColor[b,g,r,a];//[[PAA_File_Format#AVGCTAGG|AVGCTAGG]] in PAA file  
   bgraHex        MaxColorHex; //MAXCTAGG in PAA file
   bytes          MaxColor[b,g,r,a];   //[[PAA_File_Format#AVGCTAGG|MAXCTAGG]] in PAA file
   ulong          Always0;
   ulong          Always0;
   ulong          AlwaysDefault;//0xFFFFFFFF
   ulong          AlwaysDefault;     // 0xFFFFFFFF
   ulong          FlagBytes;   // 01 01 00 10 typical
   ulong          FlagBytes;         // 01 01 00 10 typical
   ulong          SameCount;   // see note
   ulong          SameCount;         // always == nMipmaps
   ulong          TextureType; // 6 = DXT1, 10 = DXT5
   ulong          TextureType;       // 6 = DXT1, 10 = DXT5
   byte          Always1;
   byte          Always1;
   byte          Always1;
   byte          Always1;
  Asciiz        *PaaFile;            //"data\icons\m4a3_cco_ca.paa"
                                    //"fnfal\data\fnfal_smdi.paa"
  ulong          Flag;
  ulong          nMipmaps;
  MipMap        MipMaps[nMipmaps];
  ushort        SomeShort
  ushort        AnotherShort;
  };
  };


TexEnd
* BIS have finally learned to use relative file addressing. This might be the precursor to a better future where we leave oops modelling nightmares behind.
{
===float color===
  ulong      Flag;
  anyfloat= anybyte/255.0;
  ulong      nMipmaps;
===mipmap===
  MipMap    MipMaps[nMipmaps];
  ushort    SomeShort
  ushort    AnotherShort;
  };
 
* SameCount always == nMipmaps
 
  MipMap
  MipMap
  {
  {
   ushort width;//typical 0040,0200
   ushort width;     //typical 0040,0200
   ushort height;//typical 0020,0100
   ushort height;     //typical 0020,0100
   ushort Always0;
   ushort Always0;
   ushort value3;//generally 0x030a
   ushort value;     //generally 0x030a
   ulong  dataOffset; //position of mipmap data in paa file
   ulong  dataOffset; //[[PAA_File_Format#AVGCTAGG|OFFSTAGG]] in PAA file. position of mipmap data in paa file
};
 
 
bgraHex
{
  byte blue, green, red, alpha;
};
 
bgraDecimal
{
  float blue, green, red, alpha;
  };
  };

Revision as of 03:45, 21 June 2011

Template:unsupported-doc

intro

TextHeader.bin is created by Binpbo personal edition 2.5 and greater. It is placed in the primary folder of the addon.pbo, and comprises of information from all pax files encountered in that addon from all it's possible data trees.

Conventions

see Generic FileFormat Data Types

File Structure

struct TexHeader.bin
{
 MimeType "0DHT" ;    // NOT asciiz. '0' = 0x30. This is mimetype "TexHeaDer0"
 ulong    version;    // 1
 ulong    nTextures;  // 
 TexBody  TexBodies[nTextures];
};

TexBody

TexBody
{
 ulong          Always1;
 ulong          Always0;
 floats         AverageColor[r,g,b,a];//AVGCTAGG floating-point equivalent. Note that order is different
 bytes          AverageColor[b,g,r,a];//AVGCTAGG in PAA file 
 bytes          MaxColor[b,g,r,a];    //MAXCTAGG in PAA file
 ulong          Always0;
 ulong          AlwaysDefault;      // 0xFFFFFFFF
 ulong          FlagBytes;          // 01 01 00 10 typical
 ulong          SameCount;          // always == nMipmaps
 ulong          TextureType;        // 6 = DXT1, 10 = DXT5
 byte           Always1;
 byte           Always1;

 Asciiz        *PaaFile;            //"data\icons\m4a3_cco_ca.paa"
                                    //"fnfal\data\fnfal_smdi.paa"
 ulong          Flag;
 ulong          nMipmaps;
 MipMap         MipMaps[nMipmaps];
 ushort         SomeShort
 ushort         AnotherShort;
};
  • BIS have finally learned to use relative file addressing. This might be the precursor to a better future where we leave oops modelling nightmares behind.

float color

anyfloat= anybyte/255.0;

mipmap

MipMap
{
 ushort width;      //typical 0040,0200
 ushort height;     //typical 0020,0100
 ushort Always0;
 ushort value;      //generally 0x030a
 ulong  dataOffset; //OFFSTAGG in PAA file. position of mipmap data in paa file
};