public static Kn5 FromStream(Stream entry, bool skipTextures = false) { var kn5 = new Kn5(string.Empty); using (var reader = new Kn5Reader(entry)) { kn5.FromFile_Header(reader); if (skipTextures) { kn5.FromFile_SkipTextures(reader); } else { kn5.FromFile_Textures(reader); } kn5.FromFile_Materials(reader); kn5.FromFile_Nodes(reader); } return kn5; }
public static Kn5 FromFile(string filename, bool skipTextures = false) { if (!File.Exists(filename)) { throw new FileNotFoundException(filename); } var kn5 = new Kn5(filename); using (var reader = new Kn5Reader(filename)) { kn5.FromFile_Header(reader); if (skipTextures) { kn5.FromFile_SkipTextures(reader); } else { kn5.FromFile_Textures(reader); } kn5.FromFile_Materials(reader); kn5.FromFile_Nodes(reader); } return kn5; }