--- deliantra/Deliantra-Client/DC/Texture.pm 2007/12/26 20:46:39 1.30 +++ deliantra/Deliantra-Client/DC/Texture.pm 2007/12/26 21:03:21 1.31 @@ -1,10 +1,10 @@ =head1 NAME -dc::Texture - tetxure class for CFPlus +DC::Texture - tetxure class for CFPlus =head1 SYNOPSIS - use dc::Texture; + use DC::Texture; =head1 DESCRIPTION @@ -12,12 +12,12 @@ =cut -package dc::Texture; +package DC::Texture; use strict; use List::Util qw(max min); -use dc::OpenGL; +use DC::OpenGL; my %TEXTURES; my ($MAX_W, $MAX_H) = (4096, 4096); # maximum texture size attempted by this module @@ -32,7 +32,7 @@ %data, }, $class; - dc::weaken ($TEXTURES{$self+0} = $self); + DC::weaken ($TEXTURES{$self+0} = $self); $self->upload unless delete $self->{delay}; @@ -132,7 +132,7 @@ } elsif (defined $self->{image}) { ($self->{w}, $self->{h}, $data, my $internalformat, $self->{format}, $self->{type}) - = dc::load_image_inline $self->{image}; + = DC::load_image_inline $self->{image}; $self->{internalformat} ||= $internalformat; ($dw, $dh) = @$self{qw(w h)}; @@ -141,13 +141,13 @@ } elsif (defined $self->{tile}) { ++$self->{loading}; - return dc::DB::get tilecache => $self->{tile}, sub { + return DC::DB::get tilecache => $self->{tile}, sub { $self->loading_done ($_[0]); }; } elsif (defined $self->{path}) { ++$self->{loading}; - return dc::DB::read_file $self->{path}, sub { + return DC::DB::read_file $self->{path}, sub { $self->loading_done ($_[0]); }; @@ -159,7 +159,7 @@ defined $data or $self->{render_cb} or die; # some sanity check - $self->{minified} ||= [dc::average $dw, $dh, $data] + $self->{minified} ||= [DC::average $dw, $dh, $data] if $self->{minify}; # against rather broken cards we enforce a maximum texture size @@ -168,8 +168,8 @@ # if only pot-textures are allowed, pot'ify tw/th unless ($GL_NPOT) { - $tw = dc::minpot $tw; - $th = dc::minpot $th; + $tw = DC::minpot $tw; + $th = DC::minpot $th; } # now further decrease texture size until the @@ -325,13 +325,13 @@ $self->unload; } -$dc::OpenGL::INIT_HOOK{"dc::Texture"} = sub { +$DC::OpenGL::INIT_HOOK{"DC::Texture"} = sub { for (values %TEXTURES) { $_->upload if $_->{want_upload}; } }; -$dc::OpenGL::SHUTDOWN_HOOK{"dc::Texture"} = sub { +$DC::OpenGL::SHUTDOWN_HOOK{"DC::Texture"} = sub { for (values %TEXTURES) { next unless $_->{name}; $_->{want_upload} = $_->{name};