From 11610a7f9c863ddfc397a6d7d4582740d361dab8 Mon Sep 17 00:00:00 2001 From: morkt Date: Thu, 7 Sep 2023 12:12:19 +0400 Subject: [PATCH] (MB): recognize 'CL' signatures as well. --- ArcFormats/ImageMB.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ArcFormats/ImageMB.cs b/ArcFormats/ImageMB.cs index b4539992..39925bdc 100644 --- a/ArcFormats/ImageMB.cs +++ b/ArcFormats/ImageMB.cs @@ -36,12 +36,26 @@ namespace GameRes.Formats public override uint Signature { get { return 0; } } public override bool CanWrite { get { return true; } } + public MbImageFormat () + { + Extensions = new[] { "bmp", "gra" }; + } + public override ImageMetaData ReadMetaData (IBinaryStream stream) { int c1 = stream.ReadByte(); int c2 = stream.ReadByte(); - if ('M' != c1 || ('B' != c2 && 'C' != c2)) - return null; + switch (c1) + { + case 'M': + if ('B' != c2 && 'C' != c2) + return null; + break; + case 'C': + if ('L' != c2) + return null; + break; + } using (var bmp = OpenAsBitmap (stream)) return Bmp.ReadMetaData (bmp); }