mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(GameSystem): support PureMail archives.
This commit is contained in:
@@ -65,6 +65,8 @@ namespace GameRes.Formats.GameSystem
|
||||
long next_offset = (long)file.View.ReadUInt32 (index_offset+12) << 9;
|
||||
if (next_offset < offset || next_offset > file.MaxOffset)
|
||||
return null;
|
||||
if (name.EndsWith (".CRGB") || name.EndsWith (".CHAR"))
|
||||
entry.Type = "image";
|
||||
entry.Offset = offset;
|
||||
entry.Size = (uint)(next_offset - offset);
|
||||
dir.Add (entry);
|
||||
@@ -101,5 +103,25 @@ namespace GameRes.Formats.GameSystem
|
||||
var ext = Encoding.ASCII.GetString (name_buf, 12, ext_end-12);
|
||||
return name + '.' + ext;
|
||||
}
|
||||
|
||||
public override IImageDecoder OpenImage (ArcFile arc, Entry entry)
|
||||
{
|
||||
if (entry.Name.EndsWith (".BGD") || entry.Name.EndsWith (".CRGB"))
|
||||
{
|
||||
var input = arc.File.CreateStream (entry.Offset, entry.Size);
|
||||
var info = new ImageMetaData { Width = 800, Height = 600, BPP = 24 };
|
||||
return new CgdReader (input, info);
|
||||
}
|
||||
else if (entry.Name.EndsWith (".CHAR"))
|
||||
{
|
||||
var input = arc.File.CreateStream (entry.Offset, entry.Size);
|
||||
var info = new ChrMetaData {
|
||||
Width = 800, Height = 600, BPP = 32,
|
||||
DataOffset = 0, RgbSize = (int)input.Length,
|
||||
};
|
||||
return new ChrReader (input, info);
|
||||
}
|
||||
return base.OpenImage (arc, entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user