Ejemplo n.º 1
0
            public Header(byte[] bytes)
            {
                magic = EndianBytesOperator.readString(bytes, 0, 4);
                if (magic != "PrOD")
                {
                    throw new InvalidDataException();
                }

                constNum1 = EndianBytesOperator.readUInt(bytes, 0x04);
                if (constNum1 != 0x01000000)
                {
                    throw new InvalidDataException();
                }

                constNum2 = EndianBytesOperator.readUInt(bytes, 0x08);
                if (constNum2 != 0x00000001)
                {
                    throw new InvalidDataException();
                }

                lstUSOffset = EndianBytesOperator.readUInt(bytes, 0x0C);
                fileSize    = EndianBytesOperator.readUInt(bytes, 0x10);
                meshCount   = EndianBytesOperator.readUInt(bytes, 0x14);
                STOffset    = EndianBytesOperator.readUInt(bytes, 0x18);

                NullPadding = EndianBytesOperator.readUInt(bytes, 0x1C);
                if (NullPadding != 0x00000000)
                {
                    throw new InvalidDataException();
                }
            }
Ejemplo n.º 2
0
            public Mesh(byte[] bytes, uint offset, List <string> names, uint stOffset)
            {
                instancesSize = EndianBytesOperator.readUInt(bytes, (int)offset + 0x0);
                size          = 0x10 + instancesSize;

                instancesCount = EndianBytesOperator.readUInt(bytes, (int)offset + 0x04);
                nameOffset     = EndianBytesOperator.readUInt(bytes, (int)offset + 0x08);
                name           = EndianBytesOperator.readString(bytes, (int)(stOffset + nameOffset));
                names.Add(name);

                instances = new List <MeshInstance>();
                for (int i = 0; i < instancesCount; i++)
                {
                    instances.Add(new MeshInstance(bytes, (uint)(offset + 0x10 + MeshInstance.size * i)));
                }
            }
Ejemplo n.º 3
0
 public static bool IsYaz0(byte[] bytes)
 {
     return(EndianBytesOperator.readString(bytes, 0, 4) == "Yaz0");
 }