Fix alpha handling resulting in no images with 24-bit bmp
This commit is contained in:
parent
9adae25874
commit
5cf95b4fc0
@ -86,6 +86,7 @@ int main (int argc, char * argv[]) {
|
||||
while (optind < argc) {
|
||||
sprite_t * image = calloc(sizeof(sprite_t),1);
|
||||
load_sprite(image, argv[optind]);
|
||||
image->alpha = ALPHA_EMBEDDED;
|
||||
|
||||
sprite_t * source = image;
|
||||
|
||||
|
@ -401,7 +401,7 @@ void load_sprite(sprite_t * sprite, char * filename) {
|
||||
if (bpp == 24) {
|
||||
color = (bufferb[i + 3 * x] & 0xFF) +
|
||||
(bufferb[i+1 + 3 * x] & 0xFF) * 0x100 +
|
||||
(bufferb[i+2 + 3 * x] & 0xFF) * 0x10000;
|
||||
(bufferb[i+2 + 3 * x] & 0xFF) * 0x10000 + 0xFF000000;
|
||||
} else if (bpp == 32) {
|
||||
if (bufferb[i + 4 * x] == 0) {
|
||||
color = 0x000000;
|
||||
|
Loading…
x
Reference in New Issue
Block a user