From: Kartik Thakore Date: Tue, 18 Aug 2009 22:56:29 +0000 (-0400) Subject: Stop spewing warnings for blit X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=db3da111b3065e44b0ecb75361879fcfc780fc54;p=sdlgit%2FSDL_perl.git Stop spewing warnings for blit --- diff --git a/lib/SDL/Surface.pm b/lib/SDL/Surface.pm index a906047..8d09500 100644 --- a/lib/SDL/Surface.pm +++ b/lib/SDL/Surface.pm @@ -202,18 +202,17 @@ sub flip { } sub blit { + $_[1] = 0 unless defined $_[1]; + $_[3] = 0 unless defined $_[3]; + if ($SDL::DEBUG) { - carp "/n SDL::Surface::blit accepting undef is depreceated use SDL::NULL" if ( !defined($_[1]) || !defined($_[3]) ); croak "SDL::Surface::blit requires SDL::Rect objects" unless ($_[1] == 0 || $_[1]->isa('SDL::Rect')) && ($_[3] == 0 || $_[3]->isa('SDL::Rect')); croak "SDL::Surface::blit requires SDL::Surface objects" unless $_[2]->isa('SDL::Surface'); } - - $_[1] = 0 unless defined $_[1]; - $_[3] = 0 unless defined $_[3]; - SDL::BlitSurface(map { (defined($_) && $_ != 0)? ${$_} : $_ } @_) if defined(@_); + SDL::BlitSurface(map { (defined($_) && $_ != 0)? ${$_} : $_ } @_) if defined(@_); } sub set_colors {