X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSDL%2FSurface.pm;h=d0a53d6cf58eafcbb540fb8611960c282bef9337;hb=eb0922d6e045045f375e4a4bcd85f57971dbfeef;hp=378907e84b310f6c5f089a18b34cf310e042e032;hpb=59f13fbaf456c061a7ed030ea560ba68f9217656;p=sdlgit%2FSDL_perl.git diff --git a/lib/SDL/Surface.pm b/lib/SDL/Surface.pm index 378907e..d0a53d6 100644 --- a/lib/SDL/Surface.pm +++ b/lib/SDL/Surface.pm @@ -163,10 +163,6 @@ sub pixel { } sub fill { - croak "SDL::Surface::fill requires a SDL::Rect object" - unless !$SDL::DEBUG || $_[1] == 0 || $_[1]->isa('SDL::Rect'); - croak "SDL::Surface::fill requires a SDL::Color object" - unless !$SDL::DEBUG || $_[2]->isa('SDL::Color'); if ($_[1] == 0 ) { SDL::FillRect(${$_[0]},0,${$_[2]}); } else { @@ -202,6 +198,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 +208,7 @@ sub blit { croak "SDL::Surface::blit requires SDL::Surface objects" unless $_[2]->isa('SDL::Surface'); } - - SDL::BlitSurface(map { (defined($_) && $_ != 0)? ${$_} : croak "SDL::blit() Parameters need to be defined" } @_) if defined(@_); + SDL::BlitSurface(map { (defined($_) && $_ != 0)? ${$_} : $_ } @_) if defined(@_); } sub set_colors {