private void Parse4(TreeNode tn, int xoff, ReadBar.Barent ent, DC curdc) { MemoryStream memoryStream = new MemoryStream(ent.bin, false); BinaryReader binaryReader = new BinaryReader(memoryStream); memoryStream.Position = 144L; int num = binaryReader.ReadInt32(); if (num == 2) { curdc.o4Map = this.Parse4_02(tn, xoff, ent); return; } if (num == 3) { curdc.o4Mdlx = this.Parse4_03(tn, xoff, ent); return; } throw new NotSupportedException("Unknown @90 .. " + num); }
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(); }