private static void AddResource(TmodFile modFile, string relPath, string filePath) { using (var src = File.OpenRead(filePath)) using (var dst = new MemoryStream()) { if (!ContentConverters.Convert(ref relPath, src, dst)) { src.CopyTo(dst); } modFile.AddFile(relPath, dst.ToArray()); } }
private void AddResource(BuildingMod mod, string resource) { var relPath = resource.Substring(mod.path.Length + 1); using (var src = File.OpenRead(resource)) using (var dst = new MemoryStream()) { if (!ContentConverters.Convert(ref relPath, src, dst)) { src.CopyTo(dst); } mod.modFile.AddFile(relPath, dst.ToArray()); } }