Permalink
Browse files

fixed namespace for Carp::cluck

  • Loading branch information...
1 parent b44a085 commit dba96c0383699d3382b8d8234ad0af4395b1d36b Tobias Leich committed Sep 11, 2010
View
2 Build.PL
@@ -32,7 +32,7 @@ my %platforms = (
);
my $package = 'My::Builder::' . ( $platforms{$^O} || 'Unix' );
print "Gonna use '$package' class ...\n";
-eval "require $package" or confess "Require '$package' failed: $@\n";
+eval "require $package" or Carp::confess "Require '$package' failed: $@\n";
### subsystems to build
# <subsystem>
View
10 examples/GFX/script_roto.pl
@@ -16,7 +16,7 @@
SDL::Rect->new( 0, 0, $display->w, $display->h ), $pixel
);
-confess SDL::get_error if !$display;
+Carp::confess SDL::get_error if !$display;
my $src = SDL::Video::load_BMP('test/data/picture.bmp');
my $temp_surf;
@@ -43,20 +43,20 @@ sub draw {
foreach ( 1 .. 360 ) {
$temp_surf = SDL::GFX::Rotozoom::surface( $src, $_, $_ / 180, 1 );
- confess SDL::get_error if !$temp_surf;
+ Carp::confess SDL::get_error if !$temp_surf;
draw( $temp_surf, 2 );
}
$temp_surf = SDL::GFX::Rotozoom::surface_xy( $src, 1, 1, 1, 1 );
-confess SDL::get_error if !$temp_surf;
+Carp::confess SDL::get_error if !$temp_surf;
draw( $temp_surf, 1000 );
$temp_surf = SDL::GFX::Rotozoom::zoom_surface( $src, 1, 1, 1 );
-confess SDL::get_error if !$temp_surf;
+Carp::confess SDL::get_error if !$temp_surf;
draw( $temp_surf, 1000 );
$temp_surf = SDL::GFX::Rotozoom::shrink_surface( $src, 1, 1 );
-confess SDL::get_error if !$temp_surf;
+Carp::confess SDL::get_error if !$temp_surf;
draw( $temp_surf, 1000 );
SDL::delay(1000);
View
4 examples/SDLx/SDLx_controller_two_squares.pl
@@ -42,7 +42,7 @@ sub init {
# Initing video
# Die here if we cannot make video init
- confess 'Cannot init ' . SDL::get_error()
+ Carp::confess 'Cannot init ' . SDL::get_error()
if ( SDL::init(SDL_INIT_VIDEO) == -1 );
# Create our display window
@@ -52,7 +52,7 @@ sub init {
SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL
);
- confess 'Cannot init video mode 800x600x32: ' . SDL::get_error()
+ Carp::confess 'Cannot init video mode 800x600x32: ' . SDL::get_error()
unless $a;
return $a;
View
4 examples/SDLx/pong.pl
@@ -71,7 +71,7 @@ sub init {
# Initing video
# Die here if we cannot make video init
- confess 'Cannot init ' . SDL::get_error()
+ Carp::confess 'Cannot init ' . SDL::get_error()
if ( SDL::init(SDL_INIT_VIDEO) == -1 );
# Create our display window
@@ -81,7 +81,7 @@ sub init {
SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL
);
- confess 'Cannot init video mode 800x600x32: ' . SDL::get_error()
+ Carp::confess 'Cannot init video mode 800x600x32: ' . SDL::get_error()
unless $a;
return $a;
View
4 examples/pixel_operations/sols/ch02.pl
@@ -44,12 +44,12 @@ sub render {
}
sub main {
- cluck 'Unable to init SDL: ' . SDL::get_error()
+ Carp::cluck 'Unable to init SDL: ' . SDL::get_error()
if ( SDL::init(SDL_INIT_VIDEO) < 0 );
$screen = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE );
- cluck 'Unable to set 640x480x32 video' . SDL::get_error() if ( !$screen );
+ Carp::cluck 'Unable to set 640x480x32 video' . SDL::get_error() if ( !$screen );
while (1) {
View
2 inc/My/Builder.pm
@@ -65,7 +65,7 @@ sub find_subsystems {
my $param;
for my $library ( @{ $subsystem->{libraries} } ) {
my $lib = $libraries->{$library}
- or confess "Unknown library '$library' for '$name'\n";
+ or Carp::confess "Unknown library '$library' for '$name'\n";
my $h =
ref( $lib->{header} ) eq 'ARRAY'
? $lib->{header}
View
10 t_backcompat/MoP/lib/SDL/Tutorial/MoP/Model/Map.pm
@@ -28,7 +28,7 @@ my $tile_size = 10;
my $path = module_file( 'SDL::Tutorial::MoP', 'data/tiles.bmp' );
my $tiles = SDL::Video::load_BMP($path);
-confess 'Error: ' . SDL::get_error() if ( !$tiles );
+Carp::confess 'Error: ' . SDL::get_error() if ( !$tiles );
my $map_surface; # the image(s) of the current map are here
my $is_up_to_date = 0;
@@ -49,7 +49,7 @@ sub new {
sub init {
my ( $self, %params ) = @_;
- $self->load_map() || cluck("load_map() failed");
+ $self->load_map() || Carp::cluck("load_map() failed");
$self->x(0);
$self->y(0);
$self->w( $self->surface()->w() );
@@ -61,7 +61,7 @@ sub init {
sub notify {
my ( $self, $event ) = (@_);
- print cluck( sprintf( "Notify '%s'in Map", $event->{name} ) )
+ print Carp::cluck( sprintf( "Notify '%s'in Map", $event->{name} ) )
if $self->{EDEBUG};
my %event_action = (
@@ -94,7 +94,7 @@ sub load_map {
$_surface = undef;
return 1;
} else {
- cluck("Could not load bitmap $_path.");
+ Carp::cluck("Could not load bitmap $_path.");
return -1;
}
}
@@ -111,7 +111,7 @@ sub get_tile_by_index {
my $self = shift;
my $index = shift || 0;
- cluck 'Unable to load tiles ' . SDL::get_error() if ( !$tiles );
+ Carp::cluck 'Unable to load tiles ' . SDL::get_error() if ( !$tiles );
my $x = ( $index * $tile_size ) % $tiles->w;
my $y = int( ( $index * $tile_size ) / $tiles->w ) * $tile_size;
View
6 t_backcompat/MoP/lib/SDL/Tutorial/MoP/View.pm
@@ -122,8 +122,8 @@ sub map_move {
sub draw_map {
my $self = shift;
- cluck('There is no surface to draw to') unless $self->{app};
- cluck('There are no tiles to draw') unless $map->tiles;
+ Carp::cluck('There is no surface to draw to') unless $self->{app};
+ Carp::cluck('There are no tiles to draw') unless $map->tiles;
# blitting the whole map-surface to app-surface
my $srect = SDL::Rect->new( 0, 0, $map->w(), $map->h() ); #we want all of map;
@@ -143,7 +143,7 @@ sub draw_scene {
$self->draw_map();
- cluck('There is no surface to draw to') unless $self->{app};
+ Carp::cluck('There is no surface to draw to') unless $self->{app};
$self->{count} = $self->{count} + 1;
View
8 t_backcompat/MoP/lib/SDL/Tutorial/MoP/View/Map.pm
@@ -41,15 +41,15 @@ my $diff = 'MoP/../../';
$diff = '../' if ( $^O =~ /linux/ );
my $path = catpath( $volume, catfile( $dirs, $diff . 'tiles.bmp' ) );
my $tiles = SDL::Video::load_BMP($path);
-confess 'Error: ' . SDL::get_error() if ( !$tiles );
+Carp::confess 'Error: ' . SDL::get_error() if ( !$tiles );
sub draw_map {
- cluck 'Unable to init SDL: ' . SDL::get_error()
+ Carp::cluck 'Unable to init SDL: ' . SDL::get_error()
if ( SDL::init(SDL_INIT_VIDEO) < 0 );
$screen = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE );
- cluck 'Unable to set 640x480x32 video ' . SDL::get_error() if ( !$screen );
+ Carp::cluck 'Unable to set 640x480x32 video ' . SDL::get_error() if ( !$screen );
move_map(MOP_LEFT);
@@ -92,7 +92,7 @@ sub move_map {
sub get_tile {
my $index = shift || 0;
- cluck 'Unable to load tiles ' . SDL::get_error() if ( !$tiles );
+ Carp::cluck 'Unable to load tiles ' . SDL::get_error() if ( !$tiles );
my $x = ( $index * $tile_size ) % $tiles->w;
my $y = int( ( $index * $tile_size ) / $tiles->w ) * $tile_size;
View
4 t_backcompat/Timer.pm
@@ -42,7 +42,7 @@ sub new {
my $func = shift;
my (%options) = @_;
- confess "SDL::Timer::new no delay specified\n"
+ Carp::confess "SDL::Timer::new no delay specified\n"
unless ( $options{-delay} );
$$self{-delay} = $options{-delay} || $options{-d} || 0;
$$self{-times} = $options{-times} || $options{-t} || 0;
@@ -52,7 +52,7 @@ sub new {
$$self{-routine} = sub { &$func; $$self{-delay} };
}
$$self{-timer} = SDL::NewTimer( $$self{-delay}, $$self{-routine} );
- confess "Could not create timer, ", SDL::get_error(), "\n"
+ Carp::confess "Could not create timer, ", SDL::get_error(), "\n"
unless ( $self->{-timer} );
bless $self, $class;
return $self;
View
8 t_backcompat/loopwave.pl
@@ -4,12 +4,12 @@
use SDL::Event;
use Carp;
-confess "Could not initialize SDL: ", SDL::GetError()
+Carp::confess "Could not initialize SDL: ", SDL::GetError()
if ( 0 > SDL::Init(SDL_INIT_AUDIO) );
$ARGV[0] ||= 'data/sample.wav';
-confess "usage: $0 [wavefile]\n"
+Carp::confess "usage: $0 [wavefile]\n"
if ( in $ARGV[0], qw/ -h --help -? / );
my ( $wav_spec, $wav_buffer, $wav_len, $wav_pos ) = ( 0, 0, 0, 0 );
@@ -49,10 +49,10 @@
( $wav_spec, $wav_buffer, $wav_len ) = @$wave;
-confess "Could not load wav file $ARGV[0], ", SDL::GetError(), "\n"
+Carp::confess "Could not load wav file $ARGV[0], ", SDL::GetError(), "\n"
unless ($wav_len);
-confess "Could not open audio ", SDL::GetError()
+Carp::confess "Could not open audio ", SDL::GetError()
if ( 0 > SDL::OpenAudio( $wav_spec, $fillerup ) );
SDL::PauseAudio(0);
View
2 t_backcompat/testsprite.pl
@@ -77,7 +77,7 @@ sub init_game_context {
$sprite = SDL::Video::load_BMP("data/icon.bmp");
- confess 'Cannot make sprite:' . SDL::get_error() if !$sprite;
+ Carp::confess 'Cannot make sprite:' . SDL::get_error() if !$sprite;
# Set transparent pixel as the pixel at (0,0)

0 comments on commit dba96c0

Please sign in to comment.