Commit 4c41ee7d authored by Sam Lantinga's avatar Sam Lantinga

Mattias' patch

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4049
parent 72f7279b
...@@ -464,7 +464,6 @@ static Uint8 *Map1toN(SDL_Palette *src, SDL_PixelFormat *dst) ...@@ -464,7 +464,6 @@ static Uint8 *Map1toN(SDL_Palette *src, SDL_PixelFormat *dst)
Uint8 *map; Uint8 *map;
int i; int i;
int bpp; int bpp;
unsigned alpha;
bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel); bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel);
map = (Uint8 *)malloc(src->ncolors*bpp); map = (Uint8 *)malloc(src->ncolors*bpp);
...@@ -473,12 +472,11 @@ static Uint8 *Map1toN(SDL_Palette *src, SDL_PixelFormat *dst) ...@@ -473,12 +472,11 @@ static Uint8 *Map1toN(SDL_Palette *src, SDL_PixelFormat *dst)
return(NULL); return(NULL);
} }
alpha = dst->Amask ? SDL_ALPHA_OPAQUE : 0;
/* We memory copy to the pixel map so the endianness is preserved */ /* We memory copy to the pixel map so the endianness is preserved */
for ( i=0; i<src->ncolors; ++i ) { for ( i=0; i<src->ncolors; ++i ) {
ASSEMBLE_RGBA(&map[i*bpp], dst->BytesPerPixel, dst, ASSEMBLE_RGBA(&map[i*bpp], dst->BytesPerPixel, dst,
src->colors[i].r, src->colors[i].g, src->colors[i].r, src->colors[i].g,
src->colors[i].b, alpha); src->colors[i].b, SDL_ALPHA_OPAQUE);
} }
return(map); return(map);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment