예제 #1
0
 public LureAnim(int resnum, string pal)
 {
     this.resnum = resnum;
     palette     = pal;
     xdata       = Decompressor.decompress(LureDisks.getResource(resnum));
     cdata       = LureDisks.getResource(resnum + 1);
 }
예제 #2
0
 static void test(string[] args)
 {
     Console.WriteLine("running test");
     int[] imgs = new int[] { 5, 0x18, 0x1A, 0x1C, 0x1E, 0x40, 0x42, 0x44, 0x46, 0x24 };
     for (int i = 0; i < imgs.Length; i++)
     {
         Console.WriteLine(String.Format("----test compression res {0:D}(0x{0:X})", imgs[i]));
         byte[] data  = LureDisks.getResource(imgs[i]);
         byte[] real  = Decompressor.decompress(data);
         byte[] udata = Compressor.compress(real);
         byte[] xdata = Decompressor.decompress(udata);
         bool   eq    = true;
         if (xdata.Length != real.Length)
         {
             eq = false;
         }
         else
         {
             for (int j = 0; j < xdata.Length && eq; j++)
             {
                 if (xdata[j] != real[j])
                 {
                     eq = false;
                 }
             }
         }
         Console.WriteLine("decompress test " + (eq?"OK":"FAILED"));
         Console.WriteLine(String.Format("res {0:d} compress real={1:d} our={2:d}", imgs[i], data.Length, udata.Length));
         eq = true;
         if (data.Length == udata.Length)
         {
             for (int j = 0; j < data.Length; j++)
             {
                 if (data[j] != udata[j])
                 {
                     eq = false;
                 }
             }
         }
         else
         {
             eq = false;
         }
         Console.WriteLine("res " + imgs[i].ToString() + " " + (eq?"EQUAL":"not equal"));
         if (!eq)
         {
             FileStream fs = new FileStream("res" + imgs[i].ToString() + "real.bin", FileMode.Create);
             fs.Write(data, 0, data.Length);
             fs.Close();
             fs = new FileStream("res" + imgs[i].ToString() + "our.bin", FileMode.Create);
             fs.Write(udata, 0, udata.Length);
             fs.Close();
             fs = new FileStream("res" + imgs[i].ToString() + "unpacked.bin", FileMode.Create);
             fs.Write(real, 0, real.Length);
             fs.Close();
         }
     }
     Console.ReadKey();
 }
예제 #3
0
 public LureImage(int resnum, int w, int h, string pal)
 {
     this.resnum = resnum;
     width       = w;
     height      = h;
     palette     = pal;
     //xdata = LureDisks.getResource(resnum);
     xdata = Decompressor.decompress(LureDisks.getResource(resnum));
 }
예제 #4
0
        static void dump(int id)
        {
            string of = LureConfig.get().outputFile(id.ToString() + ".bin");

            Console.WriteLine("dumping " + id.ToString() + " to " + of);
            byte[] data = LureDisks.getResource(id);
            if (LureConfig.get().compress)
            {
                data = Decompressor.decompress(data);
            }
            LureCommon.dumpFile(data, of);
        }
예제 #5
0
 public LureStringList(int id)
 {
     resnum = id;
     data   = LureDisks.getResource(id);
 }
예제 #6
0
 public LureText(int resnum)
 {
     this.resnum = resnum;
     data        = LureDisks.getResource(resnum);
 }