Compiling for cocoa now works. Does it run? We'll see.
authoregottlieb
Tue, 03 Aug 2010 23:22:31 -0400
changeset 48303dfe779900f5
parent 4829 7160e833c4ac
child 4831 8dabd625079f
Compiling for cocoa now works. Does it run? We'll see.
src/video/SDL_shape.c
src/video/SDL_shape_internals.h
src/video/cocoa/SDL_cocoashape.m
     1.1 --- a/src/video/SDL_shape.c	Tue Aug 03 21:56:05 2010 -0400
     1.2 +++ b/src/video/SDL_shape.c	Tue Aug 03 23:22:31 2010 -0400
     1.3 @@ -196,7 +196,7 @@
     1.4  	return result;
     1.5  }
     1.6  
     1.7 -void SDL_TraverseShapeTree(SDL_ShapeTree *tree,void(*function)(SDL_ShapeTree*,void*),void* closure) {
     1.8 +void SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure) {
     1.9  	if(tree->kind == QuadShape) {
    1.10  		SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upleft,function,closure);
    1.11  		SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upright,function,closure);
     2.1 --- a/src/video/SDL_shape_internals.h	Tue Aug 03 21:56:05 2010 -0400
     2.2 +++ b/src/video/SDL_shape_internals.h	Tue Aug 03 23:22:31 2010 -0400
     2.3 @@ -51,10 +51,12 @@
     2.4  	SDL_ShapeKind kind;
     2.5  	SDL_ShapeUnion data;
     2.6  } SDL_ShapeTree;
     2.7 +	
     2.8 +typedef void(*SDL_TraversalFunction)(SDL_ShapeTree*,void*);
     2.9  
    2.10  extern void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb);
    2.11  extern SDL_ShapeTree* SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape,SDL_bool invert);
    2.12 -extern void SDL_TraverseShapeTree(SDL_ShapeTree *tree,void(*function)(SDL_ShapeTree*,void*),void* closure);
    2.13 +extern void SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure);
    2.14  extern void SDL_FreeShapeTree(SDL_ShapeTree** shapeTree);
    2.15  
    2.16  /* Ends C function definitions when using C++ */
     3.1 --- a/src/video/cocoa/SDL_cocoashape.m	Tue Aug 03 21:56:05 2010 -0400
     3.2 +++ b/src/video/cocoa/SDL_cocoashape.m	Tue Aug 03 23:22:31 2010 -0400
     3.3 @@ -59,7 +59,7 @@
     3.4  	return [[((SDL_WindowData*)window->driverdata)->nswindow contentView] convertRectFromBase:nsrect];
     3.5  }
     3.6  
     3.7 -void ConglomerateShapeTree(SDL_ShapeTree* tree,SDL_PathConglomeration cong) {
     3.8 +void ConglomerateShapeTree(SDL_ShapeTree* tree,SDL_PathConglomeration* cong) {
     3.9  	if(tree->kind == OpaqueShape) {
    3.10  		NSRect rect = convert_rect(tree->data.shape,cong->window);
    3.11  		[cong->clipPath appendBezierPathWithRect:rect];
    3.12 @@ -84,7 +84,7 @@
    3.13  	
    3.14  	SDL_PathConglomeration cong = {clipPath,shaper->window};
    3.15  	
    3.16 -	SDL_TraverseShapeTree(data->shape,&ConglomerateShapeTree,cong);
    3.17 +	SDL_TraverseShapeTree(data->shape,(SDL_TraversalFunction)&ConglomerateShapeTree,(void*)&cong);
    3.18  	
    3.19  	[clipPath addClip];
    3.20  }