From 226fdc16e64a99422d102f5fafe08ad1c9ee25f0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Apr 2013 09:33:33 -0700 Subject: [PATCH] BMP files don't contain alpha information in the palette, the fourth element is reserved and must be zero. --- src/video/SDL_bmp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index a6341f4c8..5b861dd93 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -260,6 +260,12 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) 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; } } }