Mercurial > sdl-ios-xcode
diff src/video/x11/SDL_x11shape.c @ 4785:ef8b32ef9793
Updated test code, updated win32 code a bit (still not complete, but hopefully tonight), and removed the last vestiges of ellipse and polygon drawing support.
author | Eli Gottlieb <eligottlieb@gmail.com> |
---|---|
date | Tue, 06 Jul 2010 22:05:22 -0400 |
parents | 2878650e0dc9 |
children | 175da36d1342 |
line wrap: on
line diff
--- a/src/video/x11/SDL_x11shape.c Fri Jul 02 12:05:47 2010 -0400 +++ b/src/video/x11/SDL_x11shape.c Tue Jul 06 22:05:22 2010 -0400 @@ -62,6 +62,7 @@ } int X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode) { + assert(shaper != NULL && shape != NULL); if(!SDL_ISPIXELFORMAT_ALPHA(SDL_MasksToPixelFormatEnum(shape->format->BitsPerPixel,shape->format->Rmask,shape->format->Gmask,shape->format->Bmask,shape->format->Amask))) return -2; if(shape->w != shaper->window->w || shape->h != shaper->window->h) @@ -69,8 +70,8 @@ SDL_ShapeData *data = shaper->driverdata; assert(data != NULL); - /* Assume that shaper->alphacutoff already has a value. */ - SDL_CalculateShapeBitmap(shaper->alphacutoff,shape,data->bitmap); + /* Assume that shaper->alphacutoff already has a value, because SDL_SetWindowShape() should have given it one. */ + SDL_CalculateShapeBitmap(shaper->alphacutoff,shape,data->bitmap,8,1); SDL_WindowData *windowdata = (SDL_WindowData*)(shaper->window->driverdata); Pixmap shapemask = XCreateBitmapFromData(windowdata->videodata->display,windowdata->xwindow,data->bitmap,shaper->window->w,shaper->window->h);