--- deliantra/Deliantra-Client/DC/Texture.pm 2007/07/24 01:24:27 1.23 +++ deliantra/Deliantra-Client/DC/Texture.pm 2007/07/29 03:58:26 1.24 @@ -42,6 +42,9 @@ sub new_from_image { my ($class, $image, %arg) = @_; + Carp::confess "tried to create texture from undefined image" + unless defined $image; + $class->new (image => $image, internalformat => undef, %arg) } @@ -107,12 +110,14 @@ } elsif (exists $self->{render_cb}) { ($dw, $dh) = @$self{qw(w h)}; - } else { + } elsif (exists $self->{image}) { ($self->{w}, $self->{h}, $data, my $internalformat, $self->{format}, $self->{type}) = CFPlus::load_image_inline $self->{image}; $self->{internalformat} ||= $internalformat; ($dw, $dh) = @$self{qw(w h)}; + } else { + Carp::confess "tried to create texture that is not data, render or image"; } my ($tw, $th) = ($dw, $dh);