better way to seek to Palette.

This commit is contained in:
prenticedavid
2019-10-23 22:31:32 +01:00
parent 748427061c
commit c84e497481
2 changed files with 2 additions and 4 deletions

View File

@@ -171,8 +171,7 @@ uint8_t showBMP(char *nm, int x, int y)
if (bmpDepth <= PALETTEDEPTH) { // these modes have separate palette
//bmpFile.seek(BMPIMAGEOFFSET); //palette is always @ 54
bmpFile.seek(50); //colorsimportant
bmpFile.seek(read32() ? 122 : 54); //important or regular palette
bmpFile.seek(bmpImageoffset - (4<<bmpDepth)); //54 for regular, diff for colorsimportant
bitmask = 0xFF;
if (bmpDepth < 8)
bitmask >>= bmpDepth;

View File

@@ -174,8 +174,7 @@ uint8_t showBMP(char *nm, int x, int y)
if (bmpDepth <= PALETTEDEPTH) { // these modes have separate palette
//bmpFile.seek(BMPIMAGEOFFSET); //palette is always @ 54
bmpFile.seek(50); //colorsimportant
bmpFile.seek(read32() ? 122 : 54); //important or regular palette
bmpFile.seek(bmpImageoffset - (4<<bmpDepth)); //54 for regular, diff for colorsimportant
bitmask = 0xFF;
if (bmpDepth < 8)
bitmask >>= bmpDepth;