Mercurial > sdl-ios-xcode
comparison src/video/SDL_shape.c @ 4836:7eb8ca721a5b
Fixed the off-by-one bug in SDL_RecursivelyCalculateShapeTree().
author | egottlieb |
---|---|
date | Fri, 06 Aug 2010 13:52:38 -0400 |
parents | fd5bb97ec05d |
children | 2e446923c9fb |
comparison
equal
deleted
inserted
replaced
4835:40b5293d0598 | 4836:7eb8ca721a5b |
---|---|
166 next.h = dimensions.h / 2; | 166 next.h = dimensions.h / 2; |
167 //These will change from recursion to recursion. | 167 //These will change from recursion to recursion. |
168 next.x = dimensions.x; | 168 next.x = dimensions.x; |
169 next.y = dimensions.y; | 169 next.y = dimensions.y; |
170 result->data.children.upleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next); | 170 result->data.children.upleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next); |
171 next.x = dimensions.w / 2 + 1; | 171 next.x = dimensions.w / 2; |
172 //Unneeded: next.y = dimensions.y; | 172 //Unneeded: next.y = dimensions.y; |
173 result->data.children.upright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next); | 173 result->data.children.upright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next); |
174 next.x = dimensions.x; | 174 next.x = dimensions.x; |
175 next.y = dimensions.h / 2 + 1; | 175 next.y = dimensions.h / 2; |
176 result->data.children.downleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next); | 176 result->data.children.downleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next); |
177 next.x = dimensions.w / 2 + 1; | 177 next.x = dimensions.w / 2; |
178 //Unneeded: next.y = dimensions.h / 2 + 1; | 178 //Unneeded: next.y = dimensions.h / 2 + 1; |
179 result->data.children.downright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next); | 179 result->data.children.downright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next); |
180 return result; | 180 return result; |
181 } | 181 } |
182 } | 182 } |