Ejemplo n.º 1
0
            internal Point(Table table, int index, AssetLoader loader)
                : base(table, index)
            {
                BinaryReader reader = loader.Reader;
                long         start  = reader.BaseStream.Position;

                loader.Expect(HeaderLength);
                loader.ExpectZeroes(4, 1);            // Probably type, always zero.
                loader.Expect(index);                 // Zero-based index of the row with this type.
                Subtype  = reader.ReadInt32();
                Position = new Vector3f(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                Rotation = Angle3.Degrees(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                int unknown1Offset = reader.ReadInt32();                 // Offset to Unknown1 from start of row.
                int unknown2Offset = reader.ReadInt32();                 // Offset to Unknown2 from start of row (Unknown1Offset + 4).
                int unknown3Offset = reader.ReadInt32();                 // Offset to Unknown3 from start of row, or 0 if none (Unknown2Offset + 4).
                int unknown4Offset = reader.ReadInt32();                 // Offset to Unknown3 from start of row (Unknown2Offset + 4 or Unknown3Offset + 12).

                loader.ExpectZeroes(4, 1);
                Name = reader.ReadStringz(EncodingShiftJis);

                reader.BaseStream.Position = start + unknown1Offset;
                loader.ExpectZeroes(4, 2);                 // Unknown1 and Unknown2
                if (unknown3Offset != 0)
                {
                    Unknowns.ReadSingles(reader, 3);
                }
                Unknowns.ReadInt32s(reader, 1);                 // -1 or values like 1002000 for events.

                var errors = loader.Errors;
            }
Ejemplo n.º 2
0
        internal ModelBoneUnknown(FolderAsset bonesFolder, int index, AssetLoader loader)
            : base(bonesFolder, index, loader)
        {
            var reader = loader.Reader;

            Unknowns.ReadSingles(reader, 3);
            reader.Require(IsDS1 ? 0xFFFFFFFFu : 0xFF000000u);
            Unknowns.ReadSingles(reader, 3);
            Unknowns.ReadInt16s(reader, 2);
            Unknowns.ReadSingles(reader, 3);
            Unknowns.ReadInt16s(reader, 2);
            reader.RequireZeroes(4 * 4);
        }
Ejemplo n.º 3
0
        internal ModelMaterialParameter(ModelMaterial material, int materialIndex, int index, AssetLoader loader)
            : base(material, index, loader)
        {
            var reader = loader.Reader;

            Material      = material;
            MaterialIndex = materialIndex;

            Value = reader.ReadStringzAtUInt32(Encoding);
            Name  = reader.ReadStringzAtUInt32(Encoding);
            Unknowns.ReadSingles(reader, 2);
            Unknowns.ReadInt16s(reader, 1);             // Always 257?
            reader.RequireZeroes(2);

            reader.RequireZeroes(12);
        }
Ejemplo n.º 4
0
        internal MCGTable2(MCG mcg, int index, AssetLoader loader)
            : base(mcg, index)
        {
            var reader = loader.Reader;

            Unknowns.ReadInt32s(reader, 1);

            int count1  = reader.ReadInt32();
            int offset1 = reader.ReadInt32();

            Table1U1 = mcg.GetTable1Slice(count1, offset1);

            Unknowns.ReadInt32s(reader, 1);

            int count2  = reader.ReadInt32();
            int offset2 = reader.ReadInt32();

            Table1U2 = mcg.GetTable1Slice(count2, offset2);

            Unknowns.ReadInt32s(reader, 2);

            Unknowns.ReadSingles(reader, 1);
        }