BMP files don't contain alpha information in the palette, the fourth element is reserved and must be zero.
authorSam Lantinga <slouken@libsdl.org>
Tue, 16 Apr 2013 09:33:33 -0700
changeset 7068 1fa727447de3
parent 7067 7ac321f6e0e4
child 7070 65df21723f58
BMP files don't contain alpha information in the palette, the fourth element is reserved and must be zero.
src/video/SDL_bmp.c
--- a/src/video/SDL_bmp.c	Tue Apr 16 01:05:32 2013 -0400
+++ b/src/video/SDL_bmp.c	Tue Apr 16 09:33:33 2013 -0700
@@ -260,6 +260,12 @@
                 SDL_RWread(src, &palette->colors[i].g, 1, 1);
                 SDL_RWread(src, &palette->colors[i].r, 1, 1);
                 SDL_RWread(src, &palette->colors[i].a, 1, 1);
+
+                /* According to Microsoft documentation, the fourth element
+                   is reserved and must be zero, so we shouldn't treat it as
+                   alpha.
+                */
+                palette->colors[i].a = SDL_ALPHA_OPAQUE;
             }
         }
     }