mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 20:04:13 +08:00
(RctFormat.Read): use ImageMetaData.FileName to extract base file location.
This commit is contained in:
parent
f355288e97
commit
58dec16f25
@ -121,7 +121,7 @@ namespace GameRes.Formats.Majiro
|
||||
if (null == meta)
|
||||
throw new ArgumentException ("RctFormat.Read should be supplied with RctMetaData", "info");
|
||||
byte[] base_image = null;
|
||||
if (meta.AddSize > 0 && OverlayFrames)
|
||||
if (meta.FileName != null && meta.AddSize > 0 && OverlayFrames)
|
||||
base_image = ReadBaseImage (file, meta);
|
||||
|
||||
file.Position = meta.DataOffset + meta.AddSize;
|
||||
@ -169,6 +169,8 @@ namespace GameRes.Formats.Majiro
|
||||
try
|
||||
{
|
||||
string name = Encodings.cp932.GetString (name_bin, 0, name_bin.Length-1);
|
||||
string dir_name = Path.GetDirectoryName (meta.FileName);
|
||||
name = Path.Combine (dir_name, name);
|
||||
if (File.Exists (name))
|
||||
{
|
||||
using (var base_file = File.OpenRead (name))
|
||||
@ -177,6 +179,7 @@ namespace GameRes.Formats.Majiro
|
||||
if (null != base_info && 0 == base_info.AddSize
|
||||
&& meta.Width == base_info.Width && meta.Height == base_info.Height)
|
||||
{
|
||||
base_info.FileName = name;
|
||||
base_file.Position = base_info.DataOffset;
|
||||
Stream input = base_file;
|
||||
if (base_info.IsEncrypted)
|
||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion ("1.1.9.92")]
|
||||
[assembly: AssemblyFileVersion ("1.1.9.92")]
|
||||
[assembly: AssemblyVersion ("1.1.9.93")]
|
||||
[assembly: AssemblyFileVersion ("1.1.9.93")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user