Пример #1
0
        public HIRC_MusicSegment(BinaryReader instream)
        {
            instream.BaseStream.Position -= 1;

            this.type           = instream.ReadByte();
            this.length         = instream.ReadUInt32();
            this.offset         = instream.BaseStream.Position;
            this.id             = instream.ReadUInt32();
            this.soundstructure = new SoundStructure(instream);

            this.unknown1   = instream.ReadBytes(37);
            this.looppoint1 = instream.ReadDouble();
            this.unknown2   = instream.ReadBytes(24);
            this.looppoint2 = instream.ReadDouble();

            /*
             * this.childObjectsCount = instream.ReadUInt32();
             * for (int x = 0; x < this.childObjectsCount; x++)
             *  this.childObjects.Add(instream.ReadUInt32());
             */
            if (instream.BaseStream.Position - offset < this.length)
            {
                this.remaining_data = instream.ReadBytes((int)(this.length - (uint)(instream.BaseStream.Position - offset)));
            }
            else if (instream.BaseStream.Position - offset > this.length)
            {
                Console.WriteLine("HIRC_MusicSegment - YOU READ TOO MUCH!!!");
            }
        }
        public HIRC_MusicSegment(BinaryReader instream)
        {
            instream.BaseStream.Position -= 1;

            this.type = instream.ReadByte();
            this.length = instream.ReadUInt32();
            this.offset = instream.BaseStream.Position;
            this.id = instream.ReadUInt32();
            this.soundstructure = new SoundStructure(instream);

            this.unknown1 = instream.ReadBytes(37);
            this.looppoint1 = instream.ReadDouble();
            this.unknown2 = instream.ReadBytes(24);
            this.looppoint2 = instream.ReadDouble();

            /*
            this.childObjectsCount = instream.ReadUInt32();
            for (int x = 0; x < this.childObjectsCount; x++)
                this.childObjects.Add(instream.ReadUInt32());
            */
            if (instream.BaseStream.Position - offset < this.length)
            {
                this.remaining_data = instream.ReadBytes((int)(this.length - (uint)(instream.BaseStream.Position - offset)));
            }
            else if (instream.BaseStream.Position - offset > this.length)
            {
                Console.WriteLine("HIRC_MusicSegment - YOU READ TOO MUCH!!!");
            }
        }