Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Compiling for cocoa now works. Does it run? We'll see.
Browse files Browse the repository at this point in the history
  • Loading branch information
egottlieb committed Aug 4, 2010
1 parent b3186c7 commit 4df641f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/video/SDL_shape.c
Expand Up @@ -196,7 +196,7 @@ SDL_ShapeTree* SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shap
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);
Expand Down
4 changes: 3 additions & 1 deletion src/video/SDL_shape_internals.h
Expand Up @@ -51,10 +51,12 @@ typedef struct {
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++ */
Expand Down
4 changes: 2 additions & 2 deletions src/video/cocoa/SDL_cocoashape.m
Expand Up @@ -59,7 +59,7 @@ NSRect convert_rect(SDL_Rect rect,SDL_Window* window) {
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];
Expand All @@ -84,7 +84,7 @@ int Cocoa_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowS

SDL_PathConglomeration cong = {clipPath,shaper->window};

SDL_TraverseShapeTree(data->shape,&ConglomerateShapeTree,cong);
SDL_TraverseShapeTree(data->shape,(SDL_TraversalFunction)&ConglomerateShapeTree,(void*)&cong);

[clipPath addClip];
}
Expand Down

0 comments on commit 4df641f

Please sign in to comment.