mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-27 07:34:00 +08:00
use VFS.GetDirectoryName() method.
This commit is contained in:
parent
1bd3799372
commit
41b9dd9a54
@ -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))
|
||||||
|
@ -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();
|
||||||
|
@ -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;
|
||||||
|
@ -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)
|
||||||
|
@ -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))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user