From 5b32c73690d0d9b7b83eab56c8be01fa9b2f8b6a Mon Sep 17 00:00:00 2001 From: Malte Langermann <54738901+gagarinlg@users.noreply.github.com> Date: Sun, 18 Sep 2022 11:21:24 +0200 Subject: [PATCH] fix: loading 32BPP BMPs --- radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp b/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp index 7b0e97c03..ecd5eb07f 100644 --- a/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp +++ b/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp @@ -1542,11 +1542,11 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) return nullptr; } if (hasAlpha) { - *dst = ARGB(pixel & 0xff, (pixel >> 24) & 0xff, (pixel >> 16) & 0xff, (pixel >> 8) & 0xff); + *dst = ARGB((pixel >> 24) & 0xff, (pixel >> 16) & 0xff, (pixel >> 8) & 0xff, pixel & 0xff); } else { - if ((pixel & 0xff) == 0xff) { - *dst = RGB(pixel >> 24, (pixel >> 16) & 0xff, (pixel >> 8) & 0xff); + if (((pixel >> 24) & 0xff) == 0xff) { + *dst = RGB(pixel >> 16, (pixel >> 8) & 0xff, pixel & 0xff); } else { hasAlpha = true; @@ -1555,7 +1555,7 @@ BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) pixel_t tmp = *p; *p = ((tmp >> 1) & 0x0f) + (((tmp >> 7) & 0x0f) << 4) + (((tmp >> 12) & 0x0f) << 8); } - *dst = ARGB(pixel & 0xff, (pixel >> 24) & 0xff, (pixel >> 16) & 0xff, (pixel >> 8) & 0xff); + *dst = ARGB((pixel >> 24) & 0xff, (pixel >> 16) & 0xff, (pixel >> 8) & 0xff, pixel & 0xff); } } MOVE_TO_NEXT_RIGHT_PIXEL(dst);