Esempio n. 1
0
        private static Mub FromStream(Stream stream)
        {
            AwesomeReader ar  = new AwesomeReader(stream, true);
            Mub           mub = new Mub();

            mub.Version             = ar.ReadInt32();
            ar.BaseStream.Position += 4; // CRC-32 hash

            int  entryCount = ar.ReadInt32(), entrySize = entryCount * 16;
            int  blobSize    = ar.ReadInt32();
            long startOffset = ar.BaseStream.Position;

            // Reads in strings
            ar.BaseStream.Seek(entrySize, SeekOrigin.Current);
            var stringBlob = ar.ReadBytes(blobSize);
            Dictionary <long, string> words = ParseBlob(stringBlob, entrySize);

            ar.BaseStream.Seek(startOffset, SeekOrigin.Begin);

            // Reads entries
            for (int i = 0; i < entryCount; i++)
            {
                float start  = ar.ReadSingle();
                int   mod    = ar.ReadInt32();
                float length = ar.ReadSingle();
                int   data   = ar.ReadInt32();

                mub.Entries.Add(new MubEntry(start, mod, length, data, data > 0 && words.ContainsKey(data) ? words[data] : ""));
            }

            return(mub);
        }
Esempio n. 2
0
 public MubExport(Mub mub)
 {
     _mub = mub;
 }