コード例 #1
0
ファイル: TDAT.cs プロジェクト: jakewestrip/RoguelikeSouls
        internal override void Read(BinaryReaderEx br)
        {
            br.BigEndian = false;
            br.ReadInt32(); // File size
            br.AssertPattern(0xC, 0x00);
            int textureCount = br.ReadInt32();

            br.AssertPattern(0x8, 0x00);
            Unk1C = br.ReadInt32();

            Textures = new List <Texture>(textureCount);
            for (int i = 0; i < textureCount; i++)
            {
                Textures.Add(new Texture(br));
            }
        }
コード例 #2
0
        internal Zero3(BinaryReaderEx br, List <BinaryReaderEx> containers)
        {
            br.BigEndian = true;

            int fileCount = br.ReadInt32();

            br.AssertInt32(0x10);
            br.AssertInt32(0x10);
            br.AssertInt32(0x800000); // Max file size (8 MB)
            br.AssertPattern(0x40, 0x00);

            Files = new List <File>(fileCount);
            for (int i = 0; i < fileCount; i++)
            {
                Files.Add(new File(br, containers));
            }
        }
コード例 #3
0
        internal override void Read(BinaryReaderEx br)
        {
            br.BigEndian = true;
            br.AssertASCII("MDL4");
            Version = br.AssertInt32(0x40001, 0x40002);
            int dataStart = br.ReadInt32();

            br.ReadInt32(); // Data length
            int dummyCount    = br.ReadInt32();
            int materialCount = br.ReadInt32();
            int boneCount     = br.ReadInt32();
            int meshCount     = br.ReadInt32();

            Unk20          = br.ReadInt32();
            BoundingBoxMin = br.ReadVector3();
            BoundingBoxMax = br.ReadVector3();
            TrueFaceCount  = br.ReadInt32();
            TotalFaceCount = br.ReadInt32();
            br.AssertPattern(0x3C, 0x00);

            Dummies = new List <Dummy>(dummyCount);
            for (int i = 0; i < dummyCount; i++)
            {
                Dummies.Add(new Dummy(br));
            }

            Materials = new List <Material>(materialCount);
            for (int i = 0; i < materialCount; i++)
            {
                Materials.Add(new Material(br));
            }

            Bones = new List <Bone>(boneCount);
            for (int i = 0; i < boneCount; i++)
            {
                Bones.Add(new Bone(br));
            }

            Meshes = new List <Mesh>(meshCount);
            for (int i = 0; i < meshCount; i++)
            {
                Meshes.Add(new Mesh(br, dataStart, Version));
            }
        }
コード例 #4
0
 internal Material(BinaryReaderEx br)
 {
     br.AssertInt32(0);
     Unk04               = br.ReadInt32();
     Unk08               = br.ReadInt32();
     Unk0C               = br.ReadInt32();
     DiffuseMapIndex     = br.ReadInt32();
     ReflectionMaskIndex = br.ReadInt32();
     ReflectionMapIndex  = br.ReadInt32();
     br.AssertInt32(-1);
     Unk20 = br.ReadVector4();
     Unk30 = br.ReadVector4();
     Unk40 = br.ReadVector4();
     br.AssertPattern(0x10, 0x00);
     Unk60 = br.ReadSingle();
     Unk64 = br.ReadSingle();
     Unk68 = br.ReadSingle();
     Unk6C = br.ReadInt32();
 }
コード例 #5
0
            internal Bone(BinaryReaderEx br)
            {
                Translation          = br.ReadVector3();
                Rotation             = br.ReadVector3();
                Scale                = br.ReadVector3();
                ParentIndex          = br.ReadInt32();
                ChildIndex           = br.ReadInt32();
                NextSiblingIndex     = br.ReadInt32();
                PreviousSiblingIndex = br.ReadInt32();
                int facesetCountA   = br.ReadInt32();
                int facesetCountB   = br.ReadInt32();
                int facesetCountC   = br.ReadInt32();
                int facesetCountD   = br.ReadInt32();
                int facesetsOffsetA = br.ReadInt32();
                int facesetsOffsetB = br.ReadInt32();
                int facesetsOffsetC = br.ReadInt32();
                int facesetsOffsetD = br.ReadInt32();

                Unk54          = br.ReadInt32();
                BoundingBoxMin = br.ReadVector3();
                BoundingBoxMax = br.ReadVector3();
                Unk70          = br.ReadInt16s(10);
                br.AssertPattern(0xC, 0x00);

                br.StepIn(facesetsOffsetA);
                {
                    FacesetsA = new List <Faceset>(facesetCountA);
                    for (int i = 0; i < facesetCountA; i++)
                    {
                        FacesetsA.Add(new Faceset(br));
                    }
                }
                br.StepOut();

                br.StepIn(facesetsOffsetB);
                {
                    FacesetsB = new List <Faceset>(facesetCountB);
                    for (int i = 0; i < facesetCountB; i++)
                    {
                        FacesetsB.Add(new Faceset(br));
                    }
                }
                br.StepOut();

                br.StepIn(facesetsOffsetC);
                {
                    FacesetsC = new List <FacesetC>(facesetCountC);
                    for (int i = 0; i < facesetCountC; i++)
                    {
                        FacesetsC.Add(new FacesetC(br));
                    }
                }
                br.StepOut();

                br.StepIn(facesetsOffsetD);
                {
                    FacesetsD = new List <FacesetC>(facesetCountD);
                    for (int i = 0; i < facesetCountD; i++)
                    {
                        FacesetsD.Add(new FacesetC(br));
                    }
                }
                br.StepOut();
            }