Skip to content

Commit

Permalink
added some explanations in rect (take 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
dod38fr committed Oct 15, 2011
1 parent 97730ff commit 1d178b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/SDLx/Validate.h
Expand Up @@ -9,6 +9,7 @@ SV *rect( SV *rect, int* new_rect_made)

if( !SvOK(rect) )
{
/* create a new zero sized rectangle */
SDL_Rect* r = safemalloc( sizeof(SDL_Rect) );
(*new_rect_made) = 1;
r->x = 0;
Expand All @@ -19,6 +20,7 @@ SV *rect( SV *rect, int* new_rect_made)
}
else if( sv_derived_from(rect, "ARRAY") )
{
/* create a new rectangle from the array */
SDL_Rect* r = safemalloc( sizeof(SDL_Rect) );
(*new_rect_made) = 1;
int ra[4];
Expand All @@ -39,6 +41,7 @@ SV *rect( SV *rect, int* new_rect_made)
}
else if( sv_isobject(rect) && sv_derived_from(rect, "SDL::Rect") )
{
/* we already had a good rect. Just pass it along */
(*new_rect_made) = 0;
retval = rect;
SvREFCNT_inc(rect);
Expand Down

0 comments on commit 1d178b5

Please sign in to comment.