Example #1
0
 public void ReadBRCTR(string FileName)
 {
     Clear();
     BRCTR = new Nintendo.MKW.BRCTR.BRCTR(File.ReadAllBytes(FileName));
     for (int i = 0; i < BRCTR._Section3.Count; i++)
     {
         dgwSection3.Rows.Add(HexUtil.Hex8(i), "FFFF", BRCTR._Section3[i].TranslationWS[0], BRCTR._Section3[i].TranslationWS[1], BRCTR._Section3[i].TranslationWS[2], BRCTR._Section3[i].ScaleWS[0], BRCTR._Section3[i].ScaleWS[1], BRCTR._Section3[i].Translation[0], BRCTR._Section3[i].Translation[1], BRCTR._Section3[i].Translation[2], BRCTR._Section3[i].Scale[0], BRCTR._Section3[i].Scale[1]);
         for (ushort j = 0; j < BRCTR._NameTable.Names.Count; j++)
         {
             if (BRCTR._Section3[i].NameOffset == 0)
             {
                 break;
             }
             if (BRCTR._Section3[i].NameOffset == BRCTR._NameTable.Offsets[j])
             {
                 dgwSection3.Rows[i].Cells[1].Value = BRCTR._NameTable.Names[j];
                 break;
             }
             else
             {
                 if (j == BRCTR._NameTable.Names.Count - 1)
                 {
                     MessageBox.Show("The entry " + HexUtil.ConvertToHex(i) + " (Name 0) refers to a not existing name. It will be replaced with 0xFFFF");
                 }
             }
         }
     }
     BoolThings(true);
     saved    = true;
     FilePath = FileName;
 }