Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
BMP files don't contain alpha information in the palette, the fourth …
…element is reserved and must be zero.
  • Loading branch information
slouken committed Apr 16, 2013
1 parent a91fbdd commit e77deee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/video/SDL_bmp.c
Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit e77deee

Please sign in to comment.