當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。