Esempio n. 1
0
        public void Read(BinaryReader binaryReader, MusicSlice slice, int layerIndex)
        {
            Index  = layerIndex;
            Offset = slice.Offset +
                     binaryReader.ReadUInt32At(slice.SubTableOffset + layerIndex * 0x04);

            Version        = binaryReader.ReadByteAt(Offset);
            Flags          = binaryReader.ReadByteAt(Offset + 0x01);
            Size           = binaryReader.ReadUInt16At(Offset + 0x02);
            MaterialIndex  = binaryReader.ReadUInt16At(Offset + 0x04);
            LoopCount      = binaryReader.ReadUInt16At(Offset + 0x06);
            UnknownAt8     = binaryReader.ReadUInt32At(Offset + 0x08);
            EndPointSample = binaryReader.ReadUInt32At(Offset + 0x0c);
        }
Esempio n. 2
0
        public MusicEntry(MusicAudioBinaryFile file, BinaryReader binaryReader, int entryIndex)
        {
            Index  = entryIndex;
            Offset = file.MusicSectionOffset +
                     binaryReader.ReadUInt32At(file.MusicSectionOffset + 0x10 + entryIndex * 0x04);

            Version    = binaryReader.ReadByteAt(Offset);
            Flags      = binaryReader.ReadByte();
            Size       = binaryReader.ReadUInt16();
            SliceCount = binaryReader.ReadByte();
            ModeCount  = binaryReader.ReadByte();
            NameSize   = binaryReader.ReadByteAt(Offset + 0x48);

            if (Version <= 8)
            {
                NameOffset = Offset + 0x10;
                Size       = 0x0f;
            }
            else
            {
                NameOffset = Offset + Size;
            }

            Name = Encoding.ASCII.GetString(binaryReader.ReadBytesAt(NameOffset, NameSize));

            TableOffset = file.AlignToBlockStart(NameOffset + NameSize + 0x0f);

            for (int sliceIndex = 0; sliceIndex < SliceCount; sliceIndex++)
            {
                var slice = new MusicSlice(binaryReader, file, this, sliceIndex);
                Slices.Add(slice);
            }

            for (int modeIndex = 0; modeIndex < ModeCount; modeIndex++)
            {
                var section = new MusicMode(this, binaryReader, modeIndex);
                Modes.Add(section);
            }
        }
Esempio n. 3
0
 public MusicLayerMaterialUser(MusicSlice slice, MusicLayer layer)
 {
     _slice = slice;
     _layer = layer;
 }