(IImageDecoder): new interface.

This commit is contained in:
morkt
2016-10-25 18:18:51 +04:00
parent 27dbb52b89
commit b05c54047d
6 changed files with 118 additions and 27 deletions

View File

@@ -722,6 +722,17 @@ namespace GameRes
return m_vfs.Top.OpenView (entry);
}
public static IImageDecoder OpenImage (Entry entry)
{
var fs = m_vfs.Top;
var arc_fs = fs as ArchiveFileSystem;
if (arc_fs != null)
return arc_fs.Source.OpenImage (entry);
var input = fs.OpenBinaryStream (entry);
return new ImageStreamDecoder (input);
}
public static Stream OpenStream (string filename)
{
return m_vfs.Top.OpenStream (m_vfs.Top.FindFile (filename));