示例#1
0
        public static BSTNSection readStream(BeBinaryReader br)
        {
            var newSect = new BSTNSection();

            newSect.count = br.ReadInt32();
            var nameOffset = br.ReadInt32();

            newSect.groups = new BSTNGroup[newSect.count];
            var groupPointers = Helpers.readInt32Array(br, newSect.count);

            br.BaseStream.Position = nameOffset;
            newSect.name           = JBST.readTerminated(br, 0x00);
            //Console.WriteLine(newSect.name);
            for (int i = 0; i < groupPointers.Length; i++)
            {
                br.BaseStream.Position = groupPointers[i];
                newSect.groups[i]      = BSTNGroup.readStream(br);
            }
            return(newSect);
        }
示例#2
0
        public static BSTNGroup readStream(BeBinaryReader br)
        {
            var newSect    = new BSTNGroup();
            var count      = br.ReadInt32();
            var nameOffset = br.ReadInt32();

            var banch = br.BaseStream.Position;

            br.BaseStream.Position = nameOffset;
            newSect.name           = JBST.readTerminated(br, 0x00);
            // Console.WriteLine($"->\t{newSect.name}");
            br.BaseStream.Position = banch;
            newSect.waves          = new string[count];
            for (int i = 0; i < count; i++)
            {
                var anch = br.BaseStream.Position + 4;
                var ofs  = br.ReadInt32();
                br.BaseStream.Position = ofs;
                newSect.waves[i]       = JBST.readTerminated(br, 0x00);
                //Console.WriteLine($"\t->\t{newSect.waves[i]}");
                br.BaseStream.Position = anch;
            }
            return(newSect);
        }