コード例 #1
0
        protected override void Read(GrnBinaryReader reader)
        {
            reader.ReadBytes(4);
            this.Offset = reader.ReadUInt32();
            reader.ReadBytes(8);

            int currentPosition = (Int32)reader.BaseStream.Position;

            reader.Seek((int)this.Offset, System.IO.SeekOrigin.Begin);
            this.NumTotalChildNodes = reader.ReadInt32();
            reader.ReadBytes(12);

            int numChildren = this.NumTotalChildNodes;

            for (int i = 0; i < numChildren; i++)
            {
                GrnNodeType nodeType  = (GrnNodeType)reader.ReadInt32();
                GrnNode     childNode = GrnNode.ReadByNodeType(reader, this, nodeType);
                this.ChildNodes.Add(childNode);
                numChildren -= childNode.NumTotalChildNodes;
                if (i > 0)
                {
                    childNode.PreviousSibling             = this.ChildNodes[i - 1];
                    childNode.PreviousSibling.NextSibling = childNode;
                }
            }

            reader.Seek(currentPosition, System.IO.SeekOrigin.Begin);
        }
コード例 #2
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.Width   = reader.ReadInt32();
     this.Height  = reader.ReadInt32();
     this.Unknown = reader.ReadInt32();
 }
コード例 #3
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.Width = reader.ReadInt32();
     this.Height = reader.ReadInt32();
     this.Unknown = reader.ReadInt32();
 }
コード例 #4
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.Unknown = reader.ReadInt32();
     this.TextureMapIndex = reader.ReadInt32();
     this.Unknown2 = reader.ReadInt32();
 }
コード例 #5
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.Unknown         = reader.ReadInt32();
     this.TextureMapIndex = reader.ReadInt32();
     this.Unknown2        = reader.ReadInt32();
 }
コード例 #6
0
        public override void ReadData(GrnBinaryReader reader, int directoryOffset)
        {
            reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
            this.FormMeshIndex = reader.ReadInt32();
            this.MaterialIndex = reader.ReadInt32();

            for (int i = 0; i < this.ChildNodes.Count; i++)
            {
                this.ChildNodes[i].ReadData(reader, directoryOffset);
            }
        }
コード例 #7
0
        public override void ReadData(GrnBinaryReader reader, int directoryOffset)
        {
            reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
            this.FormMeshIndex = reader.ReadInt32();
            this.MaterialIndex = reader.ReadInt32();

            for (int i = 0; i < this.ChildNodes.Count; i++)
            {
                this.ChildNodes[i].ReadData(reader, directoryOffset);
            }
        }
コード例 #8
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     int count = reader.ReadInt32();
     for (int i = 0; i < count; ++i)
     {
         int faceIndex = reader.ReadInt32();
         this.TextureIndices.Add(faceIndex, new List<int>());
         this.TextureIndices[faceIndex].Add(reader.ReadInt32());
         this.TextureIndices[faceIndex].Add(reader.ReadInt32());
         this.TextureIndices[faceIndex].Add(reader.ReadInt32());
     }
 }
コード例 #9
0
        public override void ReadData(GrnBinaryReader reader, int directoryOffset)
        {
            reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
            Int32 numString = reader.ReadInt32();
            Int32 stringDataLength = reader.ReadInt32();

            Strings.Capacity = numString;
            for (int i = 0; i < numString; i++)
            {
                Strings.Add(reader.ReadString());
            }

            //reader.ReadBytes((-stringDataLength) & 3); // padding
        }
コード例 #10
0
        public override void ReadData(GrnBinaryReader reader, int directoryOffset)
        {
            reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
            Int32 numString        = reader.ReadInt32();
            Int32 stringDataLength = reader.ReadInt32();

            Strings.Capacity = numString;
            for (int i = 0; i < numString; i++)
            {
                Strings.Add(reader.ReadString());
            }

            //reader.ReadBytes((-stringDataLength) & 3); // padding
        }
コード例 #11
0
        public override void ReadData(GrnBinaryReader reader, int directoryOffset)
        {
            reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
            int count = reader.ReadInt32();

            for (int i = 0; i < count; ++i)
            {
                int faceIndex = reader.ReadInt32();
                this.TextureIndices.Add(faceIndex, new List <int>());
                this.TextureIndices[faceIndex].Add(reader.ReadInt32());
                this.TextureIndices[faceIndex].Add(reader.ReadInt32());
                this.TextureIndices[faceIndex].Add(reader.ReadInt32());
            }
        }
コード例 #12
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     for (int i = 0; i < this.GetReadDataLength() / 4; ++i)
     {
         this.TransformChannelIndices.Add(reader.ReadInt32());
     }
 }
コード例 #13
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     for (int i = 0; i < this.GetReadDataLength() / 4; ++i)
     {
         this.TransformChannelIndices.Add(reader.ReadInt32());
     }
 }
コード例 #14
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.BoneIndex = reader.ReadInt32();
     this.Unknown = reader.ReadSingle();
     this.OBBMin = reader.ReadVector3D();
     this.OBBMax = reader.ReadVector3D();
 }
コード例 #15
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.BoneIndex = reader.ReadInt32();
     this.Unknown   = reader.ReadSingle();
     this.OBBMin    = reader.ReadVector3D();
     this.OBBMax    = reader.ReadVector3D();
 }
コード例 #16
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.Unknown = reader.ReadInt32(); // maybe count for whether its UV or UVW
     for (int i = 0; i < this.GetReadDataLength() / 12; ++i)
     {
         this.TextureCoordinates.Add(reader.ReadVector3D());
     }
 }
コード例 #17
0
        public override void ReadData(GrnBinaryReader reader, int directoryOffset)
        {
            reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
            int weightsCount = reader.ReadInt32();

            this.HighestBoneIndex         = reader.ReadInt32(); // unknown (12 Jormund.grn)
            this.HighestVertexWeightCount = reader.ReadInt32(); // unknown (2 Jormund.grn)
            for (int i = 0; i < weightsCount; ++i)
            {
                this.VertexWeights.Add(new VertexWeight());
                int boneCount = reader.ReadInt32();
                for (int j = 0; j < boneCount; ++j)
                {
                    this.VertexWeights[i].BoneIndices.Add(reader.ReadInt32());
                    this.VertexWeights[i].Weights.Add(reader.ReadSingle());
                }
            }
        }
コード例 #18
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.ParentIndex = reader.ReadInt32();
     this.Position = reader.ReadVector3D();
     this.Rotation = reader.ReadQuaternion();
     this.Scale = reader.ReadMatrix3x3();
     if (this.GetReadDataLength() != this.GetWriteDataLength()) throw new Exception("bbb");
 }
コード例 #19
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.Unknown = reader.ReadInt32(); // maybe count for whether its UV or UVW
     for (int i = 0; i < this.GetReadDataLength() / 12; ++i)
     {
         this.TextureCoordinates.Add(reader.ReadVector3D());
     }
 }
コード例 #20
0
        protected virtual void Read(GrnBinaryReader reader)
        {
            this.Offset             = reader.ReadUInt32();
            this.NumTotalChildNodes = reader.ReadInt32();

            int numChildren = this.NumTotalChildNodes;

            for (int i = 0; i < numChildren; i++)
            {
                GrnNodeType nodeType  = (GrnNodeType)reader.ReadInt32();
                GrnNode     childNode = GrnNode.ReadByNodeType(reader, this, nodeType);
                this.ChildNodes.Add(childNode);
                numChildren -= childNode.NumTotalChildNodes;
                if (i > 0)
                {
                    childNode.PreviousSibling             = this.ChildNodes[i - 1];
                    childNode.PreviousSibling.NextSibling = childNode;
                }
            }
        }
コード例 #21
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.ParentIndex = reader.ReadInt32();
     this.Position    = reader.ReadVector3D();
     this.Rotation    = reader.ReadQuaternion();
     this.Scale       = reader.ReadMatrix3x3();
     if (this.GetReadDataLength() != this.GetWriteDataLength())
     {
         throw new Exception("bbb");
     }
 }
コード例 #22
0
        protected override void Read(GrnBinaryReader reader)
        {
            this.NumTotalChildNodes = reader.ReadInt32();

            reader.ReadBytes(8);
            this.FileLength = reader.ReadUInt32();
            reader.ReadBytes(12);

            for (int i = 0; i < NumTotalChildNodes; i++)
            {
                GrnNodeType nodeType  = (GrnNodeType)reader.ReadInt32();
                GrnNode     childNode = GrnNode.ReadByNodeType(reader, this, nodeType);
                this.ChildNodes.Add(childNode);
                if (i > 0)
                {
                    childNode.PreviousSibling             = this.ChildNodes[i - 1];
                    childNode.PreviousSibling.NextSibling = childNode;
                }
            }

            this.ReadData(reader, 0);
        }
コード例 #23
0
        public override void ReadData(GrnBinaryReader reader, int directoryOffset)
        {
            reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
            this.TransformChannelIndex = reader.ReadInt32();
            if (this.PreviousSibling != null &&
                ((GrnAnimationTransformTrackKeysNode)this.PreviousSibling).TransformChannelIndex == this.TransformChannelIndex)
            {
                return;
            }

            // read 5 unknowns
            for (int i = 0; i < 5; ++i)
            {
                this.Unknown[i] = reader.ReadInt32();
            }

            int numPositions  = reader.ReadInt32();
            int numRotations  = reader.ReadInt32();
            int numTransforms = reader.ReadInt32();

            // read 4 unknowns
            for (int i = 0; i < 4; ++i)
            {
                this.Unknown2[i] = reader.ReadInt32();
            }

            for (int i = 0; i < numPositions; ++i)
            {
                this.PositionKeys.Add(reader.ReadSingle());
            }
            for (int i = 0; i < numRotations; ++i)
            {
                this.RotationKeys.Add(reader.ReadSingle());
            }
            for (int i = 0; i < numTransforms; ++i)
            {
                this.ScaleKeys.Add(reader.ReadSingle());
            }

            for (int i = 0; i < numPositions; ++i)
            {
                this.Positions.Add(reader.ReadVector3D());
            }
            for (int i = 0; i < numRotations; ++i)
            {
                this.Rotations.Add(reader.ReadQuaternion());
            }
            for (int i = 0; i < numTransforms; ++i)
            {
                this.Scales.Add(reader.ReadMatrix3x3());
            }
        }
コード例 #24
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     for (int i = 0; i < this.GetReadDataLength() / 24; ++i)
     {
         this.Faces.Add(new Face());
         this.Faces[i].Indices.Add((Int16)reader.ReadInt32());
         this.Faces[i].Indices.Add((Int16)reader.ReadInt32());
         this.Faces[i].Indices.Add((Int16)reader.ReadInt32());
         this.Faces[i].NormalIndices.Add(reader.ReadInt32());
         this.Faces[i].NormalIndices.Add(reader.ReadInt32());
         this.Faces[i].NormalIndices.Add(reader.ReadInt32());
     }
 }
コード例 #25
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     for (int i = 0; i < this.GetReadDataLength() / 24; ++i)
     {
         this.Faces.Add(new Face());
         this.Faces[i].Indices.Add((Int16)reader.ReadInt32());
         this.Faces[i].Indices.Add((Int16)reader.ReadInt32());
         this.Faces[i].Indices.Add((Int16)reader.ReadInt32());
         this.Faces[i].NormalIndices.Add(reader.ReadInt32());
         this.Faces[i].NormalIndices.Add(reader.ReadInt32());
         this.Faces[i].NormalIndices.Add(reader.ReadInt32());
     }
 }
コード例 #26
0
        public override void ReadData(GrnBinaryReader reader, int directoryOffset)
        {
            reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
            this.TransformChannelIndex = reader.ReadInt32();
            if (this.PreviousSibling != null &&
                ((GrnAnimationTransformTrackKeysNode)this.PreviousSibling).TransformChannelIndex == this.TransformChannelIndex)
            {
                return;
            }

            // read 5 unknowns
            for (int i = 0; i < 5; ++i)
            {
                this.Unknown[i] = reader.ReadInt32();
            }

            int numPositions = reader.ReadInt32();
            int numRotations = reader.ReadInt32();
            int numTransforms = reader.ReadInt32();

            // read 4 unknowns
            for (int i = 0; i < 4; ++i)
            {
                this.Unknown2[i] = reader.ReadInt32();
            }

            for (int i = 0; i < numPositions; ++i)
            {
                this.PositionKeys.Add(reader.ReadSingle());
            }
            for (int i = 0; i < numRotations; ++i)
            {
                this.RotationKeys.Add(reader.ReadSingle());
            }
            for (int i = 0; i < numTransforms; ++i)
            {
                this.ScaleKeys.Add(reader.ReadSingle());
            }

            for (int i = 0; i < numPositions; ++i)
            {
                this.Positions.Add(reader.ReadVector3D());
            }
            for (int i = 0; i < numRotations; ++i)
            {
                this.Rotations.Add(reader.ReadQuaternion());
            }
            for (int i = 0; i < numTransforms; ++i)
            {
                this.Scales.Add(reader.ReadMatrix3x3());
            }
        }
コード例 #27
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.DataExtensionIndex = reader.ReadInt32();
 }
コード例 #28
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     this.DataExtensionIndex = reader.ReadInt32();
 }
コード例 #29
0
        protected override void Read(GrnBinaryReader reader)
        {
            this.NumTotalChildNodes = reader.ReadInt32();

            reader.ReadBytes(8);
            this.FileLength = reader.ReadUInt32();
            reader.ReadBytes(12);

            for (int i = 0; i < NumTotalChildNodes; i++)
            {
                GrnNodeType nodeType = (GrnNodeType)reader.ReadInt32();
                GrnNode childNode = GrnNode.ReadByNodeType(reader, this, nodeType);
                this.ChildNodes.Add(childNode);
                if (i > 0)
                {
                    childNode.PreviousSibling = this.ChildNodes[i - 1];
                    childNode.PreviousSibling.NextSibling = childNode;
                }
            }

            this.ReadData(reader, 0);
        }
コード例 #30
0
        protected override void Read(GrnBinaryReader reader)
        {
            reader.ReadBytes(4);
            this.Offset = reader.ReadUInt32();
            reader.ReadBytes(8);

            int currentPosition = (Int32)reader.BaseStream.Position;
            reader.Seek((int)this.Offset, System.IO.SeekOrigin.Begin);
            this.NumTotalChildNodes = reader.ReadInt32();
            reader.ReadBytes(12);

            int numChildren = this.NumTotalChildNodes;
            for (int i = 0; i < numChildren; i++)
            {
                GrnNodeType nodeType = (GrnNodeType)reader.ReadInt32();
                GrnNode childNode = GrnNode.ReadByNodeType(reader, this, nodeType);
                this.ChildNodes.Add(childNode);
                numChildren -= childNode.NumTotalChildNodes;
                if (i > 0)
                {
                    childNode.PreviousSibling = this.ChildNodes[i - 1];
                    childNode.PreviousSibling.NextSibling = childNode;
                }
            }

            reader.Seek(currentPosition, System.IO.SeekOrigin.Begin);
        }
コード例 #31
0
 public override void ReadData(GrnBinaryReader reader, int directoryOffset)
 {
     reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin);
     int weightsCount = reader.ReadInt32();
     this.HighestBoneIndex = reader.ReadInt32(); // unknown (12 Jormund.grn)
     this.HighestVertexWeightCount = reader.ReadInt32(); // unknown (2 Jormund.grn)
     for (int i = 0; i < weightsCount; ++i)
     {
         this.VertexWeights.Add(new VertexWeight());
         int boneCount = reader.ReadInt32();
         for (int j = 0; j < boneCount; ++j)
         {
             this.VertexWeights[i].BoneIndices.Add(reader.ReadInt32());
             this.VertexWeights[i].Weights.Add(reader.ReadSingle());
         }
     }
 }