/// <summary> /// Opens a new TFC file for writing /// </summary> /// <param name="randomizations"></param> /// <param name="dlcTfcName"></param> public static void StartNewTFCs(List <RTexture2D> randomizations) { ActiveBuilder = new TFCBuilder(); ActiveBuilder.TextureRandomizations = randomizations; var dlcTFCPath = MERFileSystem.GetTFCPath(true); // DLC TFC ActiveBuilder.DLCTFCNameProp = new NameProperty(Path.GetFileNameWithoutExtension(dlcTFCPath), "TextureFileCacheName"); //Written into texture properties ActiveBuilder.DLCTFCGuid = Guid.NewGuid(); ActiveBuilder.DLCTFCGuidProp = StructProperty.FromGuid(ActiveBuilder.DLCTFCGuid, "TFCFileGuid"); //Written into texture properties ActiveBuilder.DLCTfcStream = new FileStream(MERFileSystem.GetTFCPath(true), FileMode.Create, FileAccess.ReadWrite); ActiveBuilder.DLCTfcStream.WriteGuid(ActiveBuilder.DLCTFCGuid); // PRELOAD TFC var bgTfcPath = MERFileSystem.GetTFCPath(false); ActiveBuilder.BGTFCNameProp = new NameProperty(Path.GetFileNameWithoutExtension(bgTfcPath), "TextureFileCacheName"); //Written into texture properties ActiveBuilder.BGTFCGuid = Guid.NewGuid(); ActiveBuilder.BGTFCGuidProp = StructProperty.FromGuid(ActiveBuilder.BGTFCGuid, "TFCFileGuid"); //Written into texture properties ActiveBuilder.BGTfcStream = new FileStream(bgTfcPath, FileMode.Create, FileAccess.ReadWrite); ActiveBuilder.BGTfcStream.WriteGuid(ActiveBuilder.BGTFCGuid); }