public void SaveDataToDisk() { PostProcessChanges(); var fileIndex = Path.Combine(LoadedGameInfo.IndexFile); var fileData = Path.Combine(LoadedGameInfo.DataFile); var x2 = new XoredFileStream(LoadedGameInfo.XorKey, fileIndex, FileMode.Create, FileAccess.Write); SaveIndexToBinaryWriter(x2); x2.Flush(); x2.Close(); x2 = new XoredFileStream(LoadedGameInfo.XorKey, fileData, FileMode.Create, FileAccess.Write); SaveDataToBinaryWriter(x2); x2.Flush(); x2.Close(); }
public void LoadDataFromDisc(string filePath) { LoadedGameInfo = Functions.FindScummGame(filePath); if (LoadedGameInfo.LoadedGame == ScummGame.None) { return; } //var fileIndex = Path.Combine(Path.GetDirectoryName(filePath), Path.GetFileNameWithoutExtension(filePath) + ".000"); //var fileData = Path.Combine(Path.GetDirectoryName(filePath), Path.GetFileNameWithoutExtension(filePath) + ".001"); var fileStream = new XoredFileStream(LoadedGameInfo.XorKey, LoadedGameInfo.IndexFile, FileMode.Open, FileAccess.Read); LoadIndexFromBinaryReader(fileStream); fileStream.Close(); fileStream = new XoredFileStream(LoadedGameInfo.XorKey, LoadedGameInfo.DataFile, FileMode.Open, FileAccess.Read); LoadDataFromBinaryReader(fileStream); fileStream.Close(); LinkDataAndIndexFile(); }