Skip to content

Commit

Permalink
Does this hack work?
Browse files Browse the repository at this point in the history
  • Loading branch information
kthakore committed Sep 17, 2011
1 parent f190967 commit 40d01bf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
10 changes: 10 additions & 0 deletions lib/SDLx/Controller.pm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ sub new {
return $self;
}


sub delay {
my $self = shift;
my $delay = shift;
my $ref = refaddr $self;

$_sleep_cycle{ $ref } = $delay if $delay;
return $self;
}

sub DESTROY {
my $self = shift;
my $ref = refaddr $self;
Expand Down
16 changes: 13 additions & 3 deletions src/Core/Video.xs
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,22 @@ fill_rect ( dest, dest_rect, pixel )
RETVAL

int
blit_surface ( src, src_rect, dest, dest_rect )
blit_surface ( src, src_rect_sv, dest, dest_rect_sv )
SDL_Surface *src
SDL_Surface *dest
SDL_Rect *src_rect
SDL_Rect *dest_rect
SV *src_rect_sv
SV *dest_rect_sv
CODE:
SDL_Rect* src_rect = NULL;
SDL_Rect* dest_rect = NULL;
if( SvOK(src_rect_sv ) )
{
src_rect = (SDL_Rect*)bag2obj(src_rect_sv);
}
if( SvOK( dest_rect_sv) )
{
dest_rect = (SDL_Rect*)bag2obj(src_rect_sv);
}
RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
OUTPUT:
RETVAL
Expand Down

0 comments on commit 40d01bf

Please sign in to comment.