This commit is contained in:
p.kosyh 2011-04-28 13:34:18 +00:00
parent 422332d0a2
commit 70ce0b0b7e

View file

@ -674,14 +674,13 @@ img_t gfx_alpha_img(img_t src, int alpha)
if (SDL_LockSurface(img) == 0) {
ptr = (Uint8*)img->pixels;
size = img->w * img->h;
while (size > 0) {
while (size --) {
Uint8 r, g, b, a;
memcpy(&col, ptr, bpp);
SDL_GetRGBA(col, img->format, &r, &g, &b, &a);
col = SDL_MapRGBA(img->format, r, g, b, a * alpha / 255);
memcpy(ptr, &col, bpp);
ptr += bpp;
-- size;
}
SDL_UnlockSurface(img);
}