From: Kartik Thakore Date: Tue, 4 Aug 2009 22:53:07 +0000 (-0400) Subject: first merge X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cc6d0c7c898f974909b02fbf99163f5fd592cd50;p=sdlgit%2FSDL_perl.git first merge --- cc6d0c7c898f974909b02fbf99163f5fd592cd50 diff --cc lib/SDL/App.pm index 1fd0b5b,b35d41e..9a152e7 --- a/lib/SDL/App.pm +++ b/lib/SDL/App.pm @@@ -36,8 -38,6 +38,7 @@@ use SDL::Event use SDL::Surface; use SDL::Rect; +our @ISA = qw(SDL::Surface); - sub DESTROY { } diff --cc lib/SDL/Cursor.pm index 847ee65,a8aee2a..d434e83 --- a/lib/SDL/Cursor.pm +++ b/lib/SDL/Cursor.pm @@@ -38,9 -40,9 +40,10 @@@ sub new verify (%options, qw/ -data -mask -x -y /) if $SDL::DEBUG; - die SDL::GetError() unless $$self; ++ my $self = \SDL::NewCursor($options{-data},$options{-mask}, $options{-x},$options{-y}); - die SDL::GetError() unless $$self; ++ croak SDL::GetError() unless $$self; bless $self, $class; $self; } diff --cc lib/SDL/Music.pm index 3184d42,711c321..5f8720a --- a/lib/SDL/Music.pm +++ b/lib/SDL/Music.pm @@@ -36,9 -38,9 +38,9 @@@ use SDL sub new { my $proto = shift; my $class = ref($proto) || $proto; - die SDL::GetError() unless $$self; my $filename = shift; my $self = \SDL::MixLoadMusic($filename); - die SDL::GetError() unless $$self; ++ croak SDL::GetError() unless $$self; bless $self,$class; return $self; } diff --cc lib/SDL/Palette.pm index 62a58f5,59868d9..df99f3f --- a/lib/SDL/Palette.pm +++ b/lib/SDL/Palette.pm @@@ -48,9 -50,9 +50,9 @@@ sub new $image = shift; $self = \$image->palette(); } else { - die SDL::GetError() unless $$self; $self = \SDL::NewPalette(256); } - die SDL::GetError() unless $$self; ++ croak SDL::GetError() unless $$self; bless $self, $class; return $self; } diff --cc lib/SDL/Rect.pm index f63dbe2,298c03e..d1d201b --- a/lib/SDL/Rect.pm +++ b/lib/SDL/Rect.pm @@@ -44,9 -46,9 +46,9 @@@ sub new my $y = $options{-y} || 0; my $w = $options{-width} || $options{-w} || 0; my $h = $options{-height} || $options{-h} || 0; - die SDL::GetError() unless $$self; my $self = \SDL::NewRect($x,$y,$w,$h); - die SDL::GetError() unless $$self; ++ croak SDL::GetError() unless $$self; bless $self,$class; return $self; } diff --cc lib/SDL/Sound.pm index f6afb27,28ebe56..ddbe144 --- a/lib/SDL/Sound.pm +++ b/lib/SDL/Sound.pm @@@ -35,8 -36,8 +36,8 @@@ sub new my $proto = shift; my $class = ref($proto) || $proto; my $filename = shift; - die SDL::GetError() unless $$self; my $self = \SDL::MixLoadWAV($filename); - die SDL::GetError() unless $$self; ++ croak SDL::GetError() unless $$self; bless $self,$class; return $self; } diff --cc lib/SDL/Tool/Graphic.pm index 4e42c5a,45b8278..5112985 --- a/lib/SDL/Tool/Graphic.pm +++ b/lib/SDL/Tool/Graphic.pm @@@ -95,6 -99,7 +99,9 @@@ sub grayScale sub invertColor { my ( $self, $surface ) = @_; ++ #Added because of strict if we needed global ++ #do $workingSurface init outside subs. + my $workingSurface; if($surface->isa('SDL::Surface')) { $workingSurface = $$surface; } else { diff --cc lib/SDL/Video.pm index a97bf0a,001624c..494679c --- a/lib/SDL/Video.pm +++ b/lib/SDL/Video.pm @@@ -42,12 -44,12 +44,12 @@@ sub new verify (%options, qw/ -name -audio / ) if $SDL::DEBUG; - my $n = $options{-name} || croak "SDL::Video must supply a filename to SDL::Video::new\n"; + my $n = $options{-name} || die "SDL::Video must supply a filename to SDL::Video::new\n"; my $a = $options{'-audio'} ? 1 : 0; my $info = new SDL::MPEG(); - die SDL::GetError() unless $$self; my $self = \SDL::NewSMPEG($n,$$info,$a); - die SDL::GetError() unless $$self; ++ croak SDL::GetError() unless $$self; bless $self,$class; $self->audio(1); $self->video(1); diff --cc make/lib/SDL/Build/MSWin32.pm index 2e23d03,d1dcbbb..0760a76 --- a/make/lib/SDL/Build/MSWin32.pm +++ b/make/lib/SDL/Build/MSWin32.pm @@@ -46,7 -47,8 +47,9 @@@ sub find_heade { for my $key (qw( LIBS PATH )) { - die "Environment variable $key is empty\n" unless $ENV{$key}; ++ #this needs to be carp because some users will have SDL libs in same folder + carp "Environment variable $key is empty\n" unless $ENV{$key}; + carp "This will probably fail the compile \nSet $key manually or try building anyway\n" unless $ENV{$key}; } my ( $self, $header, $includes ) = @_; @@@ -108,7 -110,7 +111,11 @@@ sub gl_vendo return 'mesa_gl' if $vendor eq 'MESA'; return 'ms_gl' if $vendor eq 'MS'; ++<<<<<<< HEAD + die "Unrecognized GL vendor '$vendor'\n"; ++======= + croak "Unrecognized GL vendor '$vendor'\n"; ++>>>>>>> sdlperl-2.1.3 } sub ms_gl_subsystems