BMP files don't contain alpha information in the palette, the fourth element is reserved and must be zero.
This commit is contained in:
parent
969adca54c
commit
226fdc16e6
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue