ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.45 by root, Mon Apr 24 08:38:35 2006 UTC vs.
Revision 1.48 by root, Tue Apr 25 11:18:48 2006 UTC

49} 49}
50 50
51sub find_rcfile($) { 51sub find_rcfile($) {
52 my $path; 52 my $path;
53 53
54 for (@INC) { 54 for (grep !ref, @INC) {
55 $path = "$_/CFClient/resources/$_[0]"; 55 $path = "$_/CFClient/resources/$_[0]";
56 return $path if -r $path; 56 return $path if -r $path;
57 } 57 }
58 58
59 die "FATAL: can't find required file $_[0]\n"; 59 die "FATAL: can't find required file $_[0]\n";
210} 210}
211 211
212sub new_from_opengl { 212sub new_from_opengl {
213 my ($class, $w, $h, $cb) = @_; 213 my ($class, $w, $h, $cb) = @_;
214 214
215 $class->new (w => $w, h => $h, render_cb => $cb) 215 $class->new (w => $w || 1, h => $h || 1, render_cb => $cb)
216} 216}
217 217
218sub topot { 218sub topot {
219 (grep $_ >= $_[0], 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768)[0] 219 (grep $_ >= $_[0], 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768)[0]
220} 220}
243 = CFClient::load_image_inline $self->{image}; 243 = CFClient::load_image_inline $self->{image};
244 } 244 }
245 245
246 my ($tw, $th) = @$self{qw(w h)}; 246 my ($tw, $th) = @$self{qw(w h)};
247 247
248 unless ($tw && $th) { 248 unless ($tw > 0 && $th > 0) {
249 $tw = $th = 1; 249 $tw = $th = 1;
250 $data = "\x00" x 64; 250 $data = "\x00" x 64;
251 } 251 }
252 252
253 $self->{minified} = [CFClient::average $tw, $th, $data] 253 $self->{minified} = [CFClient::average $tw, $th, $data]

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines