BMP files don't contain alpha information in the palette, the fourth element is reserved and must be zero.

This commit is contained in:
Sam Lantinga 2013-04-16 09:33:33 -07:00
parent 969adca54c
commit 226fdc16e6

View file

@ -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;
}
}
}