From c84e49748106d0af4f848c67c7b4415846241d0c Mon Sep 17 00:00:00 2001 From: prenticedavid Date: Wed, 23 Oct 2019 22:31:32 +0100 Subject: [PATCH] better way to seek to Palette. --- examples/showBMP_kbv_Uno/showBMP_kbv_Uno.ino | 3 +-- examples/showBMP_not_Uno/showBMP_not_Uno.ino | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/showBMP_kbv_Uno/showBMP_kbv_Uno.ino b/examples/showBMP_kbv_Uno/showBMP_kbv_Uno.ino index 0aec12e..9711b1d 100644 --- a/examples/showBMP_kbv_Uno/showBMP_kbv_Uno.ino +++ b/examples/showBMP_kbv_Uno/showBMP_kbv_Uno.ino @@ -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; diff --git a/examples/showBMP_not_Uno/showBMP_not_Uno.ino b/examples/showBMP_not_Uno/showBMP_not_Uno.ino index c1639b4..6b1c278 100644 --- a/examples/showBMP_not_Uno/showBMP_not_Uno.ino +++ b/examples/showBMP_not_Uno/showBMP_not_Uno.ino @@ -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;