internal void ResolveReferences(BNSAXMLFile parsedBNSA, Frame owningFrame) { Console.Write("----Resolving MiniFrame OAMList Index " + OAMDataListIndex); ResolvedOAMDataList = owningFrame.ResolvedOAMDataListGroup.OAMDataLists[OAMDataListIndex]; if (ResolvedOAMDataList == null) { Console.WriteLine("... Failed to resolve: " + OAMDataListIndex); } else { Console.WriteLine("... OK"); } }
/// <summary> /// Maps the OAM Data List Index to the proper data list object /// </summary> /// <param name="parsedBNSA">Parsed BNSA File to link against</param> internal void ResolveReferences(BNSAFile parsedBNSA, Frame frame) { Console.Write("Resolving OAMIndex " + OAMDataListIndex); ResolvedOAMDataList = frame.ResolvedOAMDataListGroup.OAMDataLists[OAMDataListIndex]; if (ResolvedOAMDataList == null) { Console.WriteLine("... Failed to resolve: " + OAMDataListIndex); } else { Console.WriteLine("... OK"); } }
/// <summary> /// Constructs an OAM Data List Group from a group index. /// </summary> /// <param name="oamDataListsBasepath">Base path for the file</param> /// <param name="groupIndex">First integer in filename</param> public OAMDataListGroup(string oamDataListsBasepath, int groupIndex) { Index = groupIndex; string baseOAMDataEntryName = oamDataListsBasepath + groupIndex + "-"; int nextListIndex = 0; OAMDataLists = new List <OAMDataList>(); while (File.Exists(baseOAMDataEntryName + nextListIndex + "-0.bin")) //group-list-firstentry.bin { //Console.WriteLine("Reading MiniFrame " + baseAnimName + nextFrameIndex + ".bin"); OAMDataList oamDataListEntry = new OAMDataList(baseOAMDataEntryName, groupIndex, nextListIndex); OAMDataLists.Add(oamDataListEntry); nextListIndex++; } }
public OAMDataListGroup(Stream stream, int index) { Index = index; Pointer = stream.Position; Console.WriteLine("--Reading OAM Data List Pointer Table (Group) at 0x" + stream.Position.ToString("X2")); int firstOAMEntryPointer = int.MaxValue; while (stream.Position < firstOAMEntryPointer + Pointer) { int oamDataEntryPointer = BNSAFile.ReadIntegerFromStream(stream); firstOAMEntryPointer = Math.Min(firstOAMEntryPointer, oamDataEntryPointer); //should only be triggered by the first pointer as it goes ascending. long nextPosition = stream.Position; //Address of next pointer in the list stream.Seek(oamDataEntryPointer + Pointer, SeekOrigin.Begin); OAMDataList oamDataList = new OAMDataList(stream); OAMDataLists.Add(oamDataList); if (nextPosition < firstOAMEntryPointer + Pointer) { //Read the next 4 bytes in the pointer table as its a new pointer stream.Seek(nextPosition, SeekOrigin.Begin); } } }