当前位置: 首页>>代码示例>>C#>>正文


C# BinaryReaderEx.ReadFixedLengthString方法代码示例

本文整理汇总了C#中BinaryReaderEx.ReadFixedLengthString方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryReaderEx.ReadFixedLengthString方法的具体用法?C# BinaryReaderEx.ReadFixedLengthString怎么用?C# BinaryReaderEx.ReadFixedLengthString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BinaryReaderEx的用法示例。


在下文中一共展示了BinaryReaderEx.ReadFixedLengthString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadSection

        public override void LoadSection(BinaryReaderEx reader)
        {
            base.LoadSection(reader);

            this.MotionInfoBlocks = new List<MotionInfoBlock>();
            int numMIBs = (this.SectionLength - 4) / bytesPerBlock;
            for (var i = 0; i < numMIBs; i++)
            {
                var mib = new MotionInfoBlock();
                mib.MotionName = reader.ReadFixedLengthString(16).Trim();
                mib.FrameCount = reader.ReadSByte();
                mib.CurveCoefficient = reader.ReadSByte();
                mib.InitialVelocity = reader.ReadSByte();
                mib.RollingFrameEnd = reader.ReadSByte();
                mib.CaseOfRightFootEnd = reader.ReadSByte();
                mib.CaseOfLeftFootEnd = reader.ReadSByte();
                mib.Unk1 = reader.ReadSByte();
                mib.Unk2 = reader.ReadSByte();
                mib.SubstituteMotionName = reader.ReadFixedLengthString(16).Trim();
                mib.SubstituteMotionStartFrame = reader.ReadSByte();
                mib.IdleFramesToBlend = reader.ReadSByte();
                mib.FrameStartingRotationStop = reader.ReadSByte();
                mib.EndsOnWhichFoot = reader.ReadSByte();
                mib.Unknown = reader.ReadInt16();

                this.MotionInfoBlocks.Add(mib);
            }
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:28,代码来源:CibmSection.cs

示例2: LoadSection

        public override void LoadSection(BinaryReaderEx reader)
        {
            base.LoadSection(reader);

            this.Strings = new List<string>();
            int numStrings = (this.SectionLength - 4) / bytesPerBlock;
            for (var i = 0; i < numStrings; i++)
            {
                this.Strings.Add(reader.ReadFixedLengthString(16).Trim());
            }
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:11,代码来源:CibcSection.cs

示例3: LoadSection

        public override void LoadSection(BinaryReaderEx reader)
        {
            base.LoadSection(reader);

            this.CibtData = new List<CibtData>();
            int numCibtBlocks = (this.SectionLength - 4) / bytesPerBlock;
            for (var i = 0; i < numCibtBlocks; i++)
            {
                var cibt = new CibtData();
                cibt.Name = reader.ReadFixedLengthString(16).Trim();
                cibt.Unk1 = reader.ReadByte();
                cibt.Unk2 = reader.ReadByte();
                cibt.Unk3 = reader.ReadByte();
                cibt.Unk4 = reader.ReadByte();
                this.CibtData.Add(cibt);
            }
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:17,代码来源:CibtSection.cs

示例4: LoadSection

        public override void LoadSection(BinaryReaderEx reader)
        {
            base.LoadSection(reader);

            this.VtexHeader = new VtexHeader();
            this.VtexHeader.Unknown1 = reader.ReadInt32();
            this.VtexHeader.DataLength = reader.ReadInt32();
            this.VtexHeader.Unknown2 = reader.ReadInt16();
            this.VtexHeader.Unknown3 = reader.ReadInt16();
            this.VtexHeader.Unknown4 = reader.ReadInt16();
            this.VtexHeader.Unknown5 = reader.ReadInt16();
            this.VtexHeader.Unknown6 = reader.ReadInt32();
            this.VtexHeader.Unknown7 = reader.ReadInt32();
            this.VtexHeader.Unknown8 = reader.ReadInt32();
            this.VtexHeader.Unknown9 = reader.ReadInt32();
            this.VtexHeader.Unknown10 = reader.ReadInt32();
            this.VtexHeader.Unknown11 = reader.ReadInt32();
            this.VtexHeader.Unknown12 = reader.ReadInt32();
            this.VtexHeader.Unknown13 = reader.ReadInt32();
            this.VtexHeader.Unknown14 = reader.ReadInt32();
            this.VtexHeader.Unknown15 = reader.ReadInt32();
            this.VtexHeader.Unknown16 = reader.ReadInt32();
            this.VtexHeader.Name = reader.ReadFixedLengthString(16).TrimEnd('\0');
            this.VtexHeader.Extension = reader.ReadFixedLengthString(8).TrimEnd('\0');
            this.VtexHeader.Unknown17 = reader.ReadInt32();
            this.VtexHeader.GtexOffset = reader.ReadInt32();
            this.VtexHeader.Unknown18 = reader.ReadInt32();
            this.VtexHeader.Unknown19 = reader.ReadInt32();

            reader.BaseStream.Position = this.SectionStart + 0x30 + this.VtexHeader.GtexOffset;

            // Load GTEX
            Gtex = new GtexData();
            Gtex.Parent = this;
            Gtex.LoadSection(reader);

            this.Children = new List<INavigable>();
            this.Children.Add(this.Gtex);
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:39,代码来源:VtexSection.cs

示例5: ReadResources

        private void ReadResources(BinaryReaderEx reader, long rstOffset)
        {
            for (var i = 0; i < this.rstChunk.ResourceOffsets.Count; i++)
            {
                long offset = rstOffset + this.rstChunk.ResourceOffsets[i];
                reader.BaseStream.Position = offset;

                ResHeader resHeader = new ResHeader();
                int magic = reader.ReadInt32();

                if (magic != 0x53455240)
                {
                    throw new InvalidOperationException("Expected @RST (0x53455240), found " + magic.ToString("X"));
                }

                resHeader.ChunkBlocks = reader.ReadInt16();
                resHeader.Unknown1 = reader.ReadInt16();
                resHeader.ResType = reader.ReadFixedLengthString(8).TrimEnd('\0');
                resHeader.Unknown2 = reader.ReadInt32();
                resHeader.Unknown3 = reader.ReadInt32();

                McbResource resource;
                switch (resHeader.ResType)
                {
                    case "String":
                        resource = new McbStrings(resHeader);
                        break;
                    case "motionC":
                        resource = new McbMotionC(resHeader);
                        break;
                    case "RIDTBL":
                    case "Effect":
                    case "ClipGid":
                        resource = new McbResource(resHeader);
                        break;
                    default:
                        throw new InvalidOperationException("Unknown Mcb Resource: " + resHeader.ResType);
                }
                resource.Parent = this;
                resource.LoadSection(reader);
                this.Children.Add(resource);
            }

            var strings = this.GetChildOfType<McbStrings>();
            var stringEntries = this.FindAllChildren<StringEntry>();
            foreach (var entry in stringEntries)
            {
                entry.DisplayName = strings.Strings[entry.StringIndex];
            }
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:50,代码来源:McbSection.cs


注:本文中的BinaryReaderEx.ReadFixedLengthString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。