--- deliantra/Deliantra-Client/DC.pm 2006/04/10 22:16:33 1.20 +++ deliantra/Deliantra-Client/DC.pm 2006/04/11 17:02:35 1.23 @@ -1,10 +1,10 @@ =head1 NAME -Crossfire::Client - undocumented utility garbage for our crossfire client +CFClient - undocumented utility garbage for our crossfire client =head1 SYNOPSIS - use Crossfire::Client; + use CFClient; =head1 DESCRIPTION @@ -12,13 +12,13 @@ =cut -package Crossfire::Client; +package CFClient; BEGIN { $VERSION = '0.1'; use XSLoader; - XSLoader::load "Crossfire::Client", $VERSION; + XSLoader::load "CFClient", $VERSION; } our %GL_EXT; @@ -32,14 +32,14 @@ $GL_NPOT = $GL_EXT{GL_ARB_texture_non_power_of_two} || $GL_VERSION >= 2; - Crossfire::Client::Texture::restore_state (); + CFClient::Texture::restore_state (); } sub find_rcfile($) { my $path; for (@INC) { - $path = "$_/Crossfire/resources/$_[0]"; + $path = "$_/CFClient/resources/$_[0]"; return $path if -r $path; } @@ -78,7 +78,7 @@ close CFG; } -package Crossfire::Client::Texture; +package CFClient::Texture; use Scalar::Util; @@ -131,10 +131,10 @@ # ) #} -sub new_from_text { - my ($class, $text, $height) = @_; +sub new_from_layout { + my ($class, $layout) = @_; - my ($w, $h, $data) = Crossfire::Client::font_render $text, $height; + my ($w, $h, $data) = $layout->render; $class->new ( width => $w, @@ -191,7 +191,7 @@ my ($tw, $th) = @$self{qw(width height)}; - unless ($GL_NPOT) { + unless ($GL_NPOT && $tw && $th) { $tw = topot $tw; $th = topot $th;