use VFS.GetDirectoryName() method.

This commit is contained in:
morkt 2016-05-20 04:07:23 +04:00
parent 1bd3799372
commit 41b9dd9a54
5 changed files with 5 additions and 5 deletions

View File

@ -51,7 +51,7 @@ namespace GameRes.Formats.Miris
public override ArcFile TryOpen (ArcView file) public override ArcFile TryOpen (ArcView file)
{ {
var base_dir = Path.GetDirectoryName (file.Name); var base_dir = VFS.GetDirectoryName (file.Name);
var base_name = Path.GetFileNameWithoutExtension (file.Name); var base_name = Path.GetFileNameWithoutExtension (file.Name);
var list_file = VFS.CombinePath (base_dir, base_name+"l.dat"); var list_file = VFS.CombinePath (base_dir, base_name+"l.dat");
if (!VFS.FileExists (list_file)) if (!VFS.FileExists (list_file))

View File

@ -296,7 +296,7 @@ namespace GameRes.Formats.Purple
// judging by the code, files with "pb3" extension could as well contain PNG or BMP images, // judging by the code, files with "pb3" extension could as well contain PNG or BMP images,
// so we couldn't just shortcut to another instance of Pb3Reader here. // so we couldn't just shortcut to another instance of Pb3Reader here.
var path = Path.GetDirectoryName (m_info.FileName); var path = VFS.GetDirectoryName (m_info.FileName);
name = VFS.CombinePath (path, name); name = VFS.CombinePath (path, name);
if (name.Equals (m_info.FileName, StringComparison.InvariantCultureIgnoreCase)) if (name.Equals (m_info.FileName, StringComparison.InvariantCultureIgnoreCase))
throw new InvalidFormatException(); throw new InvalidFormatException();

View File

@ -297,7 +297,7 @@ namespace GameRes.Formats.Entis
if ((meta.BPP + 7) / 8 < 3) if ((meta.BPP + 7) / 8 < 3)
throw new InvalidFormatException(); throw new InvalidFormatException();
ref_file = VFS.CombinePath (Path.GetDirectoryName (meta.FileName), ref_file); ref_file = VFS.CombinePath (VFS.GetDirectoryName (meta.FileName), ref_file);
using (var ref_src = VFS.OpenSeekableStream (ref_file)) using (var ref_src = VFS.OpenSeekableStream (ref_file))
{ {
var ref_info = ReadMetaData (ref_src) as EriMetaData; var ref_info = ReadMetaData (ref_src) as EriMetaData;

View File

@ -151,7 +151,7 @@ namespace GameRes.Formats.Glib2
{ {
try try
{ {
var info_name = VFS.CombinePath (Path.GetDirectoryName (image_name), "info"); var info_name = VFS.CombinePath (VFS.GetDirectoryName (image_name), "info");
if (!VFS.FileExists (info_name)) if (!VFS.FileExists (info_name))
return null; return null;
if (string.IsNullOrEmpty (m_last_info_dir) if (string.IsNullOrEmpty (m_last_info_dir)

View File

@ -182,7 +182,7 @@ namespace GameRes.Formats.Majiro
try try
{ {
string name = Encodings.cp932.GetString (name_bin, 0, name_bin.Length-1); string name = Encodings.cp932.GetString (name_bin, 0, name_bin.Length-1);
string dir_name = Path.GetDirectoryName (meta.FileName); string dir_name = VFS.GetDirectoryName (meta.FileName);
name = VFS.CombinePath (dir_name, name); name = VFS.CombinePath (dir_name, name);
if (VFS.FileExists (name)) if (VFS.FileExists (name))
{ {