Permalink
Browse files

make fill_rect accept 0 for Rect and accept h==0||w==0 for the same

  • Loading branch information...
mig0 committed May 13, 2012
1 parent 6fc98ef commit 3a24456577f8a274a5bafa37dc509132dac33a04
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/Core/Video.xs
View
@@ -422,11 +422,19 @@ save_BMP ( surface, filename )
RETVAL
int
-fill_rect ( dest, dest_rect, pixel )
+fill_rect ( dest, dest_rect_bag, pixel )
SDL_Surface *dest
- SDL_Rect *dest_rect
+ SV *dest_rect_bag
Uint32 pixel
CODE:
+ SDL_Rect *dest_rect = NULL;
+
+ if (SvOK(dest_rect_bag))
+ dest_rect = (SDL_Rect *)bag2obj(dest_rect_bag);
+
+ if (dest_rect && (!dest_rect->w || !dest_rect->h))
+ dest_rect = NULL;
+
RETVAL = SDL_FillRect(dest,dest_rect,pixel);
OUTPUT:
RETVAL

1 comment on commit 3a24456

Hey can you give me a pull request for this?

Please sign in to comment.