(PsbOpener.OpenArcFile): new method.

This commit is contained in:
morkt 2017-02-21 08:27:25 +04:00
parent 872842d408
commit cd2e43d61c

View File

@ -77,6 +77,19 @@ namespace GameRes.Formats.Emote
try try
{ {
if (reader.Parse (key)) if (reader.Parse (key))
return OpenArcFile (reader, file);
if (!reader.IsEncrypted)
break;
}
catch { /* ignore parse errors caused by invalid key */ }
}
if (reader.ParseNonEncrypted())
return OpenArcFile (reader, file);
return null;
}
}
ArcFile OpenArcFile (PsbReader reader, ArcView file)
{ {
var dir = reader.GetTextures(); var dir = reader.GetTextures();
if (null == dir) if (null == dir)
@ -85,21 +98,6 @@ namespace GameRes.Formats.Emote
return null; return null;
return new ArcFile (file, this, dir); return new ArcFile (file, this, dir);
} }
if (!reader.IsEncrypted)
break;
}
catch { /* ignore parse errors caused by invalid key */ }
}
if (reader.ParseNonEncrypted())
{
var dir = reader.GetLayers();
if (null == dir)
return null;
return new ArcFile (file, this, dir);
}
return null;
}
}
public override IImageDecoder OpenImage (ArcFile arc, Entry entry) public override IImageDecoder OpenImage (ArcFile arc, Entry entry)
{ {