Fixed test for hardware or underlying fails
[sdlgit/SDL_perl.git] / lib / SDL / Surface.pm
index 7075482..8d09500 100644 (file)
@@ -202,6 +202,9 @@ sub flip {
 }
 
 sub blit {
+               $_[1] = 0 unless defined $_[1];
+               $_[3] = 0 unless defined $_[3];
+
        if ($SDL::DEBUG) {
                croak "SDL::Surface::blit requires SDL::Rect objects"
                        unless ($_[1] == 0 || $_[1]->isa('SDL::Rect'))
@@ -209,8 +212,7 @@ sub blit {
                croak "SDL::Surface::blit requires SDL::Surface objects"
                        unless $_[2]->isa('SDL::Surface'); 
        }
-       
-       SDL::BlitSurface(map { (defined($_) && $_ != 0)? ${$_} : $_ } @_) if defined(@_);
+               SDL::BlitSurface(map { (defined($_) && $_ != 0)? ${$_} : $_ } @_) if defined(@_);
 }
 
 sub set_colors {