(MB): recognize 'CL' signatures as well.

This commit is contained in:
morkt 2023-09-07 12:12:19 +04:00
parent 9c36a800a3
commit 11610a7f9c

View File

@ -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);
}