From 175e9b265ca869bb4390e59097e030106660fb62 Mon Sep 17 00:00:00 2001 From: Chong Kai Xiong Date: Sat, 25 Jan 2025 18:32:09 +0800 Subject: [PATCH] Core (LV::Video): Additional comments in BMP loader on color table reading. --- libvisual/libvisual/private/lv_video_bmp.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libvisual/libvisual/private/lv_video_bmp.cpp b/libvisual/libvisual/private/lv_video_bmp.cpp index 1299795d..90a37b7a 100644 --- a/libvisual/libvisual/private/lv_video_bmp.cpp +++ b/libvisual/libvisual/private/lv_video_bmp.cpp @@ -352,9 +352,13 @@ namespace LV { return nullptr; } + /* Load the palette */ + + /* Skip past DIB header to color table */ + /* BI_BITFIELDS and BI_ALPHABITFIELDS are unsupported, so there are + no bitmasks after the DIB header. */ fp.seekg (dib_header_pos + std::streampos {bi_size}, std::ios::beg); - /* Load the palette */ if (bi_bitcount < 24) { if (bi_clrused == 0) { /* When the colors used variable is zero, use the @@ -392,6 +396,8 @@ namespace LV { if (palette) video->set_palette (*palette); + /* Read and decode image data */ + /* Set to the beginning of image data, note that MickeySoft likes stuff upside down .. */ fp.seekg (bf_bits, std::ios::beg);