Пример #1
0
 public BSprites(uint fnum, string pal)
     : base(fnum, ResView.SpritesView.get())
 {
     this.pal = pal;
     byte[] data           = getData();
     SkyDisk.DinnerEntry e = SkyDisk.get().fileInfo((int)fnum, false);
     hdr     = new SkyDisk.FileHeader(data);
     sprdata = new byte[data.Length - SkyDisk.FileHeader.size];
     Array.Copy(data, SkyDisk.FileHeader.size, sprdata, 0, sprdata.Length);
     unused = sprdata.Length - (hdr.width * hdr.height * hdr.n_sprites);
 }
Пример #2
0
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            textBox1.Text = "";
            if (listView1.SelectedItems.Count != 1)
            {
                return;
            }
            uint fnum = uint.Parse(listView1.SelectedItems[0].SubItems[0].Text);

            SkyDisk.FileHeader fh = SkyDisk.get().readHeader(fnum);
            String             s  = String.Format(@"flags=0x{0:X}
x={1:d} (0x{1:X})
y={2:d} (0x{2:X})
width={3:d} (0x{3:X})
height={4:d} (0x{4:X})
sp_size=0x{5:X}
tot_size=0x{6:X}
n_sprites={7:d} (0x{7:X})
offset_x={8:d} (0x{8:X})
offset_y={9:d} (0x{9:X})
compressed_size=0x{10:X}
-------
total_size=0x{11:X}
flags_byte=0x{12:X}
"
                                                  , fh.flags, fh.x, fh.y, fh.width, fh.height, fh.sp_size, fh.tot_size,
                                                  fh.n_sprites, fh.offset_x, fh.offset_y, fh.compressed_size, fh.totalsize, fh.flagbyte
                                                  );

            textBox1.Text = s;
            clearRes();
            Config.FileInfo fi = Config.get().findFile(fnum);
            if (fi.fid != 0)
            {
                BResource res = BResourceHelper.getResource(fi.node);
                if (res.control != null)
                {
                    cntrl = res.control;
                    panel1.Controls.Add(cntrl);
                    res.initControl();
                }
                textBox2.Text = fi.comment;
                label2.Text   = String.Format("{0:d} unused bytes", res.unusedBytes);
            }
        }
Пример #3
0
 public BSprites(uint fnum, string pal)
     : base(fnum, ResView.SpritesView.get())
 {
     this.pal = pal;
     byte[] data = getData();
     SkyDisk.DinnerEntry e=SkyDisk.get().fileInfo((int)fnum, false);
     hdr = new SkyDisk.FileHeader(data);
     sprdata = new byte[data.Length - SkyDisk.FileHeader.size];
     Array.Copy(data, SkyDisk.FileHeader.size, sprdata, 0, sprdata.Length);
     unused = sprdata.Length - (hdr.width * hdr.height*hdr.n_sprites);
 }