Mercurial > sdl-ios-xcode
diff src/video/SDL_shape.c @ 4795:6f0bc179771c
Numerous bug fixes that keep testeyes from crashing and dying.
author | Eli Gottlieb <eligottlieb@gmail.com> |
---|---|
date | Wed, 14 Jul 2010 00:49:28 -0400 |
parents | a6bc01875d20 |
children | e8caf178d082 |
line wrap: on
line diff
--- a/src/video/SDL_shape.c Tue Jul 13 02:43:49 2010 -0400 +++ b/src/video/SDL_shape.c Wed Jul 14 00:49:28 2010 -0400 @@ -48,7 +48,7 @@ void SDL_CalculateShapeBitmap(Uint8 alphacutoff,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb,Uint8 value) { int x = 0; int y = 0; - Uint8 alpha = 0; + Uint8 r = 0,g = 0,b = 0,alpha = 0; Uint8* pixel; Uint32 bitmap_pixel; if(SDL_MUSTLOCK(shape)) @@ -57,7 +57,7 @@ for(y = 0;y<shape->h;y++) { pixel = shape->pixels + (y*shape->pitch) + (x*shape->format->BytesPerPixel); alpha = 0; - SDL_GetRGBA(*(Uint32*)pixel,shape->format,NULL,NULL,NULL,&alpha); + SDL_GetRGBA(*(Uint32*)pixel,shape->format,&r,&g,&b,&alpha); Uint32 bitmap_pixel = y*shape->w + x; bitmap[bitmap_pixel / ppb] |= (alpha >= alphacutoff ? value : 0) << ((ppb - 1) - (bitmap_pixel % ppb)); }