lock unlock

This commit is contained in:
p.kosyh 2011-04-13 18:04:18 +00:00
parent 46c0de716b
commit 91a46a853f

View file

@ -593,6 +593,7 @@ img_t gfx_alpha_img(img_t src, int alpha)
if (!img)
return NULL;
SDL_SetAlpha(img, SDL_SRCALPHA, SDL_ALPHA_OPAQUE);
SDL_LockSurface(img);
ptr = (Uint32*)img->pixels;
size = img->w * img->h;
while (size --) {
@ -603,6 +604,7 @@ img_t gfx_alpha_img(img_t src, int alpha)
*ptr = col;
ptr ++;
}
SDL_UnlockSurface(img);
return img;
}