Пример #1
0
        public void prepare(byte[] data)
        {
            UInt16 skipTbl = ByteHelper.READ_UINT16_LE(data);
            UInt16 txtData = ByteHelper.READ_UINT16_LE(data, 2);
            int    ofs     = 4;

            while (ofs < skipTbl)
            {
                blocksizes.Add(ByteHelper.READ_UINT16_LE(data, ofs));
                ofs += 2;
            }
            ofs = skipTbl;
            for (int i = 0; i < blocksizes.Count + 1; i++)
            {
                int bc = 32;
                if (i == blocksizes.Count)
                {
                    lastblksz = txtData - ofs;
                    bc        = lastblksz;
                }
                for (int j = 0; j < bc; j++)
                {
                    UInt16 b = data[ofs];
                    ofs++;
                    if ((b & 0x80) != 0)
                    {
                        b  &= 0x7F;
                        b <<= 3;
                    }
                    skipBytes.Add(b);
                }
            }
            tdata = new byte[data.Length - txtData];
            Array.Copy(data, txtData, tdata, 0, tdata.Length);
        }
Пример #2
0
 public FileHeader(byte[] bts)
 {
     buf = new byte[22];
     Array.Copy(bts, buf, 22);
     flags           = ByteHelper.READ_UINT16_LE(bts);
     x               = ByteHelper.READ_UINT16_LE(bts, 2);
     y               = ByteHelper.READ_UINT16_LE(bts, 4);
     width           = ByteHelper.READ_UINT16_LE(bts, 6);
     height          = ByteHelper.READ_UINT16_LE(bts, 8);
     sp_size         = ByteHelper.READ_UINT16_LE(bts, 10);
     tot_size        = ByteHelper.READ_UINT16_LE(bts, 12);
     n_sprites       = ByteHelper.READ_UINT16_LE(bts, 14);
     offset_x        = ByteHelper.READ_UINT16_LE(bts, 16);
     offset_y        = ByteHelper.READ_UINT16_LE(bts, 18);
     compressed_size = ByteHelper.READ_UINT16_LE(bts, 20);
 }
Пример #3
0
        public BScripts(uint fnum)
            : base(fnum, ResView.ScriptView.get())
        {
            uint sz = ByteHelper.READ_UINT16_LE(getData());
            //scrofs.Add();
            int pos = 2;

            while (pos <= sz * 2)//scrofs[0]*2)
            {
                scrofs.Add(ByteHelper.READ_UINT16_LE(getData(), pos));
                pos += 2;
            }
            int lsz = (getData().Length - pos) / 2;

            scrdata = new UInt16[lsz];
            for (int i = 0; i < lsz; i++)
            {
                scrdata[i] = ByteHelper.READ_UINT16_LE(getData(), pos);
                pos       += 2;
            }
        }