Exemple #1
0
 private CollReader Parse6(TreeNode tn, int xoff, ReadBar.Barent ent)
 {
     MemoryStream memoryStream = new MemoryStream(ent.bin, false);
     new BinaryReader(memoryStream);
     CollReader collReader = new CollReader();
     collReader.Read(memoryStream);
     StringWriter stringWriter = new StringWriter();
     int num = 0;
     foreach (Co1 current in collReader.alCo1)
     {
         stringWriter.WriteLine("Co1[{0,2}] {1}", num, current);
         num++;
     }
     stringWriter.WriteLine("--");
     int num2 = 0;
     foreach (Co2 current2 in collReader.alCo2)
     {
         stringWriter.WriteLine("Co2[{0,3}] {1}", num2, current2);
         num2++;
     }
     stringWriter.WriteLine("--");
     int num3 = 0;
     foreach (Co3 current3 in collReader.alCo3)
     {
         stringWriter.WriteLine("Co3[{0,3}] {1}", num3, current3);
         num3++;
     }
     stringWriter.WriteLine("--");
     int num4 = 0;
     foreach (Vector4 current4 in collReader.alCo4)
     {
         stringWriter.WriteLine("Co4[{0,3}] {1}", num4, current4);
         num4++;
     }
     stringWriter.WriteLine("--");
     int num5 = 0;
     foreach (Plane current5 in collReader.alCo5)
     {
         stringWriter.WriteLine("Co5[{0,3}] {1}", num5, current5);
         num5++;
     }
     stringWriter.WriteLine("--");
     TreeNode treeNode = tn.Nodes.Add("collision");
     treeNode.Tag = new RDForm.Strif(xoff, stringWriter.ToString());
     return collReader;
 }
Exemple #2
0
 private void LoadMap(string fp)
 {
     this.linkLabel1.Text = fp;
     this.rdbin = File.ReadAllBytes(fp);
     this.hv1.SetBin(this.rdbin);
     this.treeView1.Nodes.Clear();
     this.errcol.Clear();
     TreeNode treeNode = this.treeView1.Nodes.Add(Path.GetExtension(fp));
     treeNode.Tag = new RDForm.Hexi(0);
     DC dC = new DC();
     this.aldc.Clear();
     int num = 0;
     ReadBar.Barent[] array = ReadBar.Explode(new MemoryStream(this.rdbin, false));
     for (int i = 0; i < array.Length; i++)
     {
         ReadBar.Barent barent = array[i];
         TreeNode treeNode2 = treeNode.Nodes.Add(string.Format("{0} ({1:x2})", barent.id, barent.k & 255));
         treeNode2.Tag = new RDForm.Hexi(barent.off, barent.len);
         if (barent.k < num)
         {
             if ((dC.o4Map != null || dC.o4Mdlx != null) && dC.o7 != null)
             {
                 this.aldc.Add(dC);
             }
             dC = new DC();
         }
         num = barent.k;
         try
         {
             int k = barent.k;
             switch (k)
             {
             case 2:
                 this.Parse02(treeNode2, barent.off, barent);
                 break;
             case 3:
                 this.Parse03(treeNode2, barent.off, barent);
                 break;
             case 4:
                 this.Parse4(treeNode2, barent.off, barent, dC);
                 dC.name = barent.id;
                 break;
             case 5:
             case 8:
             case 9:
             case 13:
             case 14:
             case 16:
             case 17:
             case 20:
             case 21:
             case 22:
             case 23:
                 break;
             case 6:
                 this.coll = this.Parse6(treeNode2, barent.off, barent);
                 break;
             case 7:
                 dC.o7 = this.ParseTex(treeNode2, barent.off, barent);
                 break;
             case 10:
                 this.Parse0a(treeNode2, barent.off, barent);
                 break;
             case 11:
             case 15:
             case 19:
                 this.Parse6(treeNode2, barent.off, barent);
                 break;
             case 12:
                 this.Parse0c(treeNode2, barent.off, barent);
                 break;
             case 18:
                 this.Parse12(treeNode2, barent.off, barent);
                 break;
             case 24:
                 this.Parse18(treeNode2, barent.off, barent);
                 break;
             default:
                 if (k != 29)
                 {
                     switch (k)
                     {
                     case 32:
                         this.Parse20(treeNode2, barent.off, barent);
                         break;
                     case 34:
                         this.Parse22(treeNode2, barent.off, barent);
                         break;
                     case 36:
                         this.Parse24(treeNode2, barent.off, barent);
                         break;
                     }
                 }
                 else
                 {
                     this.Parse1D(treeNode2, barent.off, barent);
                 }
                 break;
             }
         }
         catch (NotSupportedException value)
         {
             this.errcol[treeNode2] = value;
             treeNode2.ImageKey = (treeNode2.SelectedImageKey = "RightsRestrictedHS.png");
         }
     }
     if ((dC.o4Map != null || dC.o4Mdlx != null) && dC.o7 != null)
     {
         this.aldc.Add(dC);
     }
     treeNode.Expand();
 }
Exemple #3
0
 public Visf(List<DC> aldc, CollReader coll)
 {
     this.aldc = aldc;
     this.coll = coll;
     this.InitializeComponent();
 }