mirror of
https://github.com/crskycode/GARbro.git
synced 2026-06-06 05:38:48 +08:00
(Bishop): Fix BSG grayscale format support
This commit is contained in:
@@ -40,6 +40,7 @@ namespace GameRes.Formats.Bishop
|
|||||||
public int DataOffset;
|
public int DataOffset;
|
||||||
public int DataSize;
|
public int DataSize;
|
||||||
public int PaletteOffset;
|
public int PaletteOffset;
|
||||||
|
public bool HasPalette;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Export(typeof(ImageFormat))]
|
[Export(typeof(ImageFormat))]
|
||||||
@@ -73,6 +74,7 @@ namespace GameRes.Formats.Bishop
|
|||||||
DataOffset = header.ToInt32 (base_offset+0x32)+base_offset,
|
DataOffset = header.ToInt32 (base_offset+0x32)+base_offset,
|
||||||
DataSize = header.ToInt32 (base_offset+0x36),
|
DataSize = header.ToInt32 (base_offset+0x36),
|
||||||
PaletteOffset = header.ToInt32 (base_offset+0x3A)+base_offset,
|
PaletteOffset = header.ToInt32 (base_offset+0x3A)+base_offset,
|
||||||
|
HasPalette = header.ToInt32 (base_offset+0x3A) != 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,9 +124,9 @@ namespace GameRes.Formats.Bishop
|
|||||||
Stride = (int)m_info.Width * 4;
|
Stride = (int)m_info.Width * 4;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
Format = PixelFormats.Indexed8;
|
Format = m_info.HasPalette ? PixelFormats.Indexed8 : PixelFormats.Gray8;
|
||||||
Stride = (int)m_info.Width;
|
Stride = (int)m_info.Width;
|
||||||
Palette = ReadPalette();
|
Palette = m_info.HasPalette ? ReadPalette() : null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user