public OverlayRecord GetOverlayRecord(int index, TableInfo.Type type) { RomFileToken token = GetCodeFileToken(); RomFile code = GetFile(token); var table = Tables.GetTable(type); if (!Addresser.TryGetRom(token, Version, table.Id, out int addr)) { return(null); } code.Stream.Position = code.Record.GetRelativeAddress(addr + (index * table.Length)); switch (type) { case TableInfo.Type.Actors: return(new ActorOverlayRecord(index, new BinaryReader(code))); case TableInfo.Type.GameOvls: return(new GameStateRecord(index, new BinaryReader(code))); case TableInfo.Type.Particles: return(new ParticleOverlayRecord(index, new BinaryReader(code))); case TableInfo.Type.PlayerPause: return(new PlayPauseOverlayRecord(index, new BinaryReader(code))); case TableInfo.Type.Transitions: return(new TransitionOverlayRecord(index, new BinaryReader(code))); default: return(null); } }
private static void MatchGeneric(TableInfo.Type type, VFileTable sourceFileList, VFileTable targetFileList, Dictionary <long, FOut> fOut, Dictionary <long, FileRecord> unmatched) { var sourceT = sourceFileList.Tables.GetTable(type); var targetT = targetFileList.Tables.GetTable(type); int iter = Math.Min(sourceT.Records, targetT.Records); for (int i = 0; i < iter; i++) { FileAddress source = sourceFileList.GetFileByTable(type, i); FileAddress target = targetFileList.GetFileByTable(type, i); TestMatch(source, target, fOut, unmatched); } }
public FileAddress GetFileByTable(TableInfo.Type type, int index) { var table = Tables.GetTable(type); return(GetFileByTable(table, index)); }