(TgaStream): interpret 8bpp images as grayscaled.

This commit is contained in:
morkt 2015-12-09 17:59:22 +04:00
parent 1c457e1249
commit 0b9391e59a

View File

@ -416,7 +416,7 @@ namespace GameRes.Formats
public static Stream Create (ImageMetaData info, byte[] pixels, bool flipped = false) public static Stream Create (ImageMetaData info, byte[] pixels, bool flipped = false)
{ {
var header = new byte[0x12]; var header = new byte[0x12];
header[2] = 2; header[2] = (byte)(info.BPP > 8 ? 2 : 3);
LittleEndian.Pack ((short)info.OffsetX, header, 8); LittleEndian.Pack ((short)info.OffsetX, header, 8);
LittleEndian.Pack ((short)info.OffsetY, header, 0xa); LittleEndian.Pack ((short)info.OffsetY, header, 0xa);
LittleEndian.Pack ((ushort)info.Width, header, 0xc); LittleEndian.Pack ((ushort)info.Width, header, 0xc);