示例#1
0
        public static BSTWaveInfo readStream(BeBinaryReader br, int fmt)
        {
            var newWI = new BSTWaveInfo();

            newWI.format = fmt;
            switch (fmt & 0xF0)
            {
            case 0x40:
                break;

            case 0x50:
                // Console.WriteLine($"{br.BaseStream.Position:X}");
                newWI.wSoundID = br.ReadInt16();
                // Console.WriteLine(newWI.wSoundID);
                break;

            case 0x60:
                break;

            case 0x70:
                newWI.streamFormat = br.ReadByte();
                newWI.unk1         = br.ReadByte();
                newWI.flags        = br.ReadUInt16();
                var namePointer = br.ReadInt32();
                br.BaseStream.Position = namePointer;
                newWI.streamFilePath   = JBST.readTerminated(br, 0x00);
                break;
            }
            return(newWI);
        }
示例#2
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);
        }
示例#3
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);
        }