My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
ReferenceFileFormatsProp  
Programmers reference on the PROP file format
Reference, Technical
Updated Feb 4, 2010 by alt.e-m...@gmx.de

PROP file format

This is about the binary file format, the list of properties is here.

General

PROP files store properties. They start with a big endian uint32_t, that's the number of properties stored.

uint32_t num_properties; //BE

This is followed by num_properties of Property structures. Property structures start with:

uint32_t hash;  //BE
uint16_t type;  //BE
uint16_t flags; //BE

Next follows the value, but how it's stored depends on the type field and the flags field. The type field might be one of the following:

TypeUnknown    = 0x00,
TypeBool       = 0x01,
TypeChar       = 0x02,
TypeWchar      = 0x03,
TypeInt8       = 0x05,
TypeUint8      = 0x06,
TypeInt16      = 0x07,
TypeUint16     = 0x08,
TypeInt32      = 0x09,
TypeUint32     = 0x0A,
TypeInt64      = 0x0B,
TypeUint64     = 0x0C,
TypeFloat      = 0x0D,
TypeDouble     = 0x0E,
TypePtr        = 0x0F,
TypeVoid       = 0x10,
TypeIUnknownRC = 0x11,
TypeString     = 0x12,
TypeWString    = 0x13,
TypeKey        = 0x20,
TypeFlags      = 0x21,
TypeText       = 0x22,
TypeVector2    = 0x30,
TypeVector3    = 0x31,
TypeColorRgb   = 0x32,
TypeVector4    = 0x33,
TypeColorRgba  = 0x34,
TypeMatrix2    = 0x35,
TypeMatrix3    = 0x36,
TypeMatrix4    = 0x37,
TypeTransform  = 0x38,
TypeBbox       = 0x39

And possible flags are:

FlagUnknown0 = 0x0001,
FlagUnknown1 = 0x0002,
FlagUnknown2 = 0x0004,
FlagUnknown3 = 0x0008,
FlagIsArray  = 0x0010,
FlagUnknown5 = 0x0020,
FlagUnknown6 = 0x0040,
FlagUnknown7 = 0x0080,
FlagUnknown8 = 0x0100,
FlagUnknown9 = 0x0200,
FlagUnknownA = 0x0400,
FlagUnknownB = 0x0800,
FlagUnknownC = 0x1000,
FlagUnknownD = 0x2000,
FlagUnknownE = 0x4000,
FlagUnknownF = 0x8000

Storage of Values

If a property stores an array FlagIsArray will be set in the flags field and two more values follow:

uint32_t count;      //BE
uint32_t item_size;  //BE

The count field indicates how many values are stored, and the item_size field indicates the byte size of one value. For some value types the size field reports an incorrect value.

Primitive Values

Primitive values are stored as single value, or as consecutive values.

Value Type Bytes Array Size Byte Order
TypeBool 1 count N/A
TypeChar 1 count N/A
TypeWchar 2 count * 2 encoding UTF-16LE
TypeInt8 1 count N/A
TypeUint8 1 count N/A
TypeInt16 2 count * 2 BE
TypeUint16 2 count * 2 BE
TypeInt32 4 count * 4 BE
TypeUint32 4 count * 4 BE
TypeInt64 8 count * 8 BE
TypeUint64 8 count * 8 BE
TypeFloat 4 count * 4 BE
TypeDouble 8 count * 8 BE

Compound Values

TypeWString

String with nchars characters, encoded as UTF-16LE.

uint32_t nchars; // BE
wchar_t[nchars]; // UTF-16LE encoded

TypeKey

3 uint32_t stored big endian. If it's just a single value 4 bytes of padding follow.

uint32_t type_id;     //BE
uint32_t group_id;    //BE
uint32_t instance_id; //BE
char pad[4];  //only if not an array

TypeVector2

2 floats stored little endian. If it's just a single value, 8 bytes of padding follow.

float x;      //LE
float y;      //LE
char  pad[8]; //only if not an array

TypeVector3

3 floats stored little endian. If it's just a single value, 4 bytes of padding follow.

float x;      //LE
float y;      //LE
float z;      //LE
char  pad[4]; //only if not an array

TypeColorRgb

3 floats stored little endian. If it's just a single value, 4 bytes of padding follow.

float r;      //LE
float g;      //LE
float b;      //LE
char  pad[4]; // only if not an array

TypeVector4

4 floats stored little endian, without any padding.

float w; //LE
float x; //LE
float y; //LE
float z; //LE

TypeColorRgba

4 floats stored little endian, without any padding.

float r; //LE
float g; //LE
float b; //LE
float a; //LE

Sign in to add a comment
Powered by Google Project Hosting