private static List <InCutsceneData> GetCutsceneOffsetData() { List <string> cutsceneStr = new(); List <InCutsceneData> cutsceneData = new(); using (TextReader reader = System.IO.File.OpenText(CUTSCENE_OFFSET_DATA_LOC)) { while (reader.Peek() > -1) { cutsceneStr.Add(reader.ReadLine()); } } //parse input data foreach (string s in cutsceneStr) { var data = s.Split(new char[] { '\t', ',' }); var inData = new InCutsceneData( int.Parse(data[0]), int.Parse(data[1]), int.Parse(data[2], System.Globalization.NumberStyles.HexNumber) & 0xFFFFFF); cutsceneData.Add(inData); } return(cutsceneData); }
private static ResultData GetData(_Scene scene, RomFile file, InCutsceneData inData) { ResultData outdata = new(scene, inData); if (!scene.TryConvertToRom(inData.RamStart, out int romAddr)) { outdata.result = ResultData.ResultType.Limit_UnallocatedSpace; return(outdata); } outdata.cutsceneRomAddress = romAddr; //else in range file.Stream.Position = file.Record.GetRelativeAddress(romAddr); try { Cutscene cs = new(file); if (cs.CommandCount < 0 || cs.Frames < 0) { outdata.result = ResultData.ResultType.Success_InvalidCutscene; } else if (cs.CommandCapReached) { outdata.result = ResultData.ResultType.Error_CutsceneParserLimitReached; } else { outdata.result = ResultData.ResultType.Success_ValidCutscene; } } catch { outdata.result = ResultData.ResultType.Exception; } return(outdata); }
public ResultData(_Scene s, InCutsceneData inData) { this.scene = s; this.inData = inData; }