internal override void ReadData(AwesomeReader ar) { Events.Clear(); ar.BaseStream.Position += 8; // Skips constants int count = ar.ReadInt32(); ar.BaseStream.Position += 4; for (int i = 0; i < count; i++) { // Reads vox entry (32 bytes) VoxEntry ev = new VoxEntry(); ev.Start = ar.ReadSingle(); ev.End = ar.ReadSingle(); ev.Pitch = ar.ReadInt24() & 0xFF; ev.PitchAlt = ar.ReadByte(); ar.BaseStream.Position += 4; // Always 0 ev.Lyric = ar.ReadUInt64(); ev.NoteType = (VoxNote)ar.ReadInt32(); ar.BaseStream.Position += 4; // Always 0 Events.Add(ev); } }
protected override void ImportData(AwesomeReader ar) { ar.ReadInt32(); // Always 8 ar.ReadInt32(); // Size of each VoxEntry (32 bytes) int count = ar.ReadInt32(); ar.ReadInt32(); // Offset to entries (Always 4) for (int i = 0; i < count; i++) { // Reads vox entry (32 bytes) VoxEntry entry = new VoxEntry(); entry.Start = ar.ReadSingle(); entry.End = ar.ReadSingle(); ar.ReadInt16(); // 2 zero'd bytes entry.Pitch = (sbyte)ar.ReadByte(); entry.SecondaryPitch = (sbyte)ar.ReadByte(); ar.ReadInt32(); // Always 0 entry.Lyric = ar.ReadInt64(); entry.NoteType = ar.ReadInt32(); ar.ReadInt32(); // Always 0 Entries.Add(entry); } }