# HG changeset patch # User egottlieb # Date 1280892151 14400 # Node ID 3dfe779900f5c847d0bb6d32a147e5329d2e1027 # Parent 7160e833c4ac3b1a55d9bd9e8eff910336d23fd1 Compiling for cocoa now works. Does it run? We'll see. diff -r 7160e833c4ac -r 3dfe779900f5 src/video/SDL_shape.c --- a/src/video/SDL_shape.c Tue Aug 03 21:56:05 2010 -0400 +++ b/src/video/SDL_shape.c Tue Aug 03 23:22:31 2010 -0400 @@ -196,7 +196,7 @@ return result; } -void SDL_TraverseShapeTree(SDL_ShapeTree *tree,void(*function)(SDL_ShapeTree*,void*),void* closure) { +void SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure) { if(tree->kind == QuadShape) { SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upleft,function,closure); SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upright,function,closure); diff -r 7160e833c4ac -r 3dfe779900f5 src/video/SDL_shape_internals.h --- a/src/video/SDL_shape_internals.h Tue Aug 03 21:56:05 2010 -0400 +++ b/src/video/SDL_shape_internals.h Tue Aug 03 23:22:31 2010 -0400 @@ -51,10 +51,12 @@ SDL_ShapeKind kind; SDL_ShapeUnion data; } SDL_ShapeTree; + +typedef void(*SDL_TraversalFunction)(SDL_ShapeTree*,void*); extern void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb); extern SDL_ShapeTree* SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape,SDL_bool invert); -extern void SDL_TraverseShapeTree(SDL_ShapeTree *tree,void(*function)(SDL_ShapeTree*,void*),void* closure); +extern void SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure); extern void SDL_FreeShapeTree(SDL_ShapeTree** shapeTree); /* Ends C function definitions when using C++ */ diff -r 7160e833c4ac -r 3dfe779900f5 src/video/cocoa/SDL_cocoashape.m --- a/src/video/cocoa/SDL_cocoashape.m Tue Aug 03 21:56:05 2010 -0400 +++ b/src/video/cocoa/SDL_cocoashape.m Tue Aug 03 23:22:31 2010 -0400 @@ -59,7 +59,7 @@ return [[((SDL_WindowData*)window->driverdata)->nswindow contentView] convertRectFromBase:nsrect]; } -void ConglomerateShapeTree(SDL_ShapeTree* tree,SDL_PathConglomeration cong) { +void ConglomerateShapeTree(SDL_ShapeTree* tree,SDL_PathConglomeration* cong) { if(tree->kind == OpaqueShape) { NSRect rect = convert_rect(tree->data.shape,cong->window); [cong->clipPath appendBezierPathWithRect:rect]; @@ -84,7 +84,7 @@ SDL_PathConglomeration cong = {clipPath,shaper->window}; - SDL_TraverseShapeTree(data->shape,&ConglomerateShapeTree,cong); + SDL_TraverseShapeTree(data->shape,(SDL_TraversalFunction)&ConglomerateShapeTree,(void*)&cong); [clipPath addClip]; }