Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
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 e77deee1515ba91672a0fa0c5d99d6bc15a6fd08
Showing with 6 additions and 0 deletions.
  1. +6 −0 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;
}
}
}

0 comments on commit e77deee

Please sign in to comment.