本文整理汇总了C#中BinaryReaderEx类的典型用法代码示例。如果您正苦于以下问题:C# BinaryReaderEx类的具体用法?C# BinaryReaderEx怎么用?C# BinaryReaderEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BinaryReaderEx类属于命名空间,在下文中一共展示了BinaryReaderEx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadSection
public override void LoadSection(BinaryReaderEx reader)
{
base.LoadSection(reader);
this.NumElements = reader.ReadInt32();
reader.BaseStream.Seek(12, System.IO.SeekOrigin.Current); // Skip 12 bytes
this.ElementOffsets = new List<ElementOffsetData>();
for (var i = 0; i < this.NumElements; i++)
{
var thing = new ElementOffsetData();
thing.BoneNameOffset = reader.ReadInt32();
thing.NameOffset = reader.ReadInt32();
thing.OffsetX = reader.ReadSingle();
thing.OffsetY = reader.ReadSingle();
thing.OffsetZ = reader.ReadSingle();
thing.Unused1 = reader.ReadInt32();
thing.Unused2 = reader.ReadInt32();
thing.Unused3 = reader.ReadInt32();
this.ElementOffsets.Add(thing);
}
foreach (var el in this.ElementOffsets)
{
reader.BaseStream.Position = this.SectionStart + el.BoneNameOffset;
el.BoneName = reader.ReadNullTerminatedString();
reader.BaseStream.Position = this.SectionStart + el.NameOffset;
el.Name = reader.ReadNullTerminatedString();
}
}
示例2: 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);
}
}
示例3: LoadData
public override void LoadData(BinaryReaderEx reader)
{
base.LoadData(reader);
this.String = reader.ReadNullTerminatedString(Encoding.ASCII);
this.DisplayName = "STR";
}
示例4: ReadHeader
private void ReadHeader(BinaryReaderEx reader)
{
this.Header = new DatDigger.Sound.AdpcmWaveFormat();
this.Header.FormatTag = (SlimDX.Multimedia.WaveFormatTag)reader.ReadInt16();
this.Header.Channels = reader.ReadInt16();
this.Header.SamplesPerSecond = reader.ReadInt32();
this.Header.AverageBytesPerSecond = reader.ReadInt32();
this.Header.BlockAlignment = reader.ReadInt16();
this.Header.BitsPerSample = reader.ReadInt16();
short cbSize = reader.ReadInt16();
if (cbSize != 0x20)
{
throw new InvalidOperationException(String.Format("Unexpected value for ADPCMWAVEFORMAT cbSize 0x{0}. Expected 0x20", cbSize));
}
this.Header.SamplesPerBlock = reader.ReadInt16();
this.Header.NumCoef = reader.ReadInt16();
this.Header.Coefficients = new List<DatDigger.Sound.AdpcmCoefficient>(this.Header.NumCoef);
for (var i = 0; i < this.Header.NumCoef; i++)
{
DatDigger.Sound.AdpcmCoefficient coef = new DatDigger.Sound.AdpcmCoefficient();
coef.A = reader.ReadInt16();
coef.B = reader.ReadInt16();
this.Header.Coefficients.Add(coef);
}
}
示例5: LoadSection
public override void LoadSection(BinaryReaderEx reader)
{
base.LoadSection(reader);
this.baseChunk = ChunkLoader.LoadChunk(SectionType.wrb, reader, this);
this.Children = new List<INavigable>();
this.Children.Add(baseChunk);
}
示例6: LoadSection
public override void LoadSection(BinaryReaderEx reader)
{
base.LoadSection(reader);
this.LoadHeader(reader);
this.LoadStringTable(reader);
this.LoadBones(reader);
}
示例7: LoadFile
public void LoadFile(BinaryReaderEx reader)
{
reader.BaseStream.Seek(8, System.IO.SeekOrigin.Begin);
this.ReadEncodedData(reader);
this.DecodeData();
this.Contents = Encoding.UTF8.GetString(this.decodedData);
}
示例8: LoadData
public void LoadData(BinaryReaderEx reader)
{
reader.ReadInt32(); // Remove PWIB bytes
this.FileSize = reader.ReadUInt32(Endianness.BigEndian);
this.Unknown = reader.ReadInt32(Endianness.BigEndian);
this.DataOffset = reader.ReadUInt32(Endianness.BigEndian);
this.LoadSection(reader);
}
示例9: LoadData
public void LoadData(BinaryReaderEx reader)
{
long pos = reader.BaseStream.Position;
BuildFormat();
reader.BaseStream.Position = pos + this.WaveHeader.FormatHeaderLength;
this.WaveData = reader.ReadBytes(this.WaveHeader.DataLength);
}
示例10: LoadSection
public override void LoadSection(BinaryReaderEx reader)
{
base.LoadSection(reader);
this.LoadHeader(reader);
this.LoadResourceTypes(reader);
this.LoadResourceIds(reader);
this.LoadStringTable(reader);
this.LoadResources(reader);
}
示例11: LoadData
public virtual void LoadData(BinaryReaderEx reader)
{
this.ChunkStart = reader.BaseStream.Position;
this.ChunkHeader = new ChunkHeader();
this.ChunkHeader.ChunkType = reader.ReadInt32();
this.ChunkHeader.Unknown1 = reader.ReadInt32(Endianness.BigEndian);
this.ChunkHeader.DataSize = reader.ReadInt32(Endianness.BigEndian);
this.ChunkHeader.NextChunkOffset = reader.ReadInt32(Endianness.BigEndian);
}
示例12: LoadSection
public virtual void LoadSection(BinaryReaderEx reader)
{
this.SectionStart = reader.BaseStream.Position;
this.SectionHeader = new SectionHeader();
this.SectionHeader.Magic = reader.ReadInt64();
this.SectionHeader.Version = reader.ReadInt32();
this.SectionHeader.Unknown2 = reader.ReadInt32();
this.SectionHeader.SectionLength = reader.ReadInt32();
this.SectionHeader.Junk = reader.ReadBytes(28);
}
示例13: 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());
}
}
示例14: LoadHeader
private void LoadHeader(BinaryReaderEx reader)
{
// Load Header
this.ResourceHeader = new ResourceHeader();
this.ResourceHeader.NumResources = reader.ReadInt32();
this.ResourceHeader.StringTableOffset = reader.ReadInt32();
this.ResourceHeader.NumStrings = reader.ReadInt32();
this.ResourceHeader.ResourceType = (SectionType)reader.ReadInt32();
this.LoadResourceInfo(reader);
}
示例15: LoadData
public override void LoadData(BinaryReaderEx reader)
{
base.LoadData(reader);
this.boundingBox.Minimum.X = reader.ReadSingle(Endianness.BigEndian);
this.boundingBox.Minimum.Y = reader.ReadSingle(Endianness.BigEndian);
this.boundingBox.Minimum.Z = reader.ReadSingle(Endianness.BigEndian);
this.boundingBox.Maximum.X = reader.ReadSingle(Endianness.BigEndian);
this.boundingBox.Maximum.Y = reader.ReadSingle(Endianness.BigEndian);
this.boundingBox.Maximum.Z = reader.ReadSingle(Endianness.BigEndian);
this.DisplayName = "AABB";
}