use SDL::Surface;
use SDL::Rect;
+our @ISA = qw(SDL::Surface);
-
sub DESTROY {
}
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;
}
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;
}
$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;
}
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;
}
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;
}
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 {
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);
{
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 ) = @_;
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