ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/utils/cfutil.in
(Generate patch)

Comparing deliantra/server/utils/cfutil.in (file contents):
Revision 1.20 by root, Mon Apr 2 18:04:47 2007 UTC vs.
Revision 1.23 by root, Tue Apr 10 09:35:24 2007 UTC

147 # possibly enlarge 147 # possibly enlarge
148 if (0 > aio_stat "$stem.64x64.png") { 148 if (0 > aio_stat "$stem.64x64.png") {
149 my $other = "$stem.64x64.png~"; 149 my $other = "$stem.64x64.png~";
150 150
151 if (0 > aio_lstat $other or (-M _) > (-M $path)) { 151 if (0 > aio_lstat $other or (-M _) > (-M $path)) {
152 warn "rescale $other\n";#d#
153 my $wrap = 0; # for the time being 152 my $wrap = 0; # for the time being
154 fork_sub { 153 fork_sub {
155 system "convert png:\Q$path\E -depth 8 rgba:-" 154 system "convert png:\Q$path\E -depth 8 rgba:-"
156 . "| $exec_prefix/bin/cfhq2xa $w $h $wrap" 155 . "| $exec_prefix/bin/cfhq2xa $w $h $wrap"
157 . "| convert -depth 8 -size ".($w * 2)."x".($h * 2)." rgba:- $QUANTIZE -quality 00 png32:\Q$other\E~" 156 . "| convert -depth 8 -size ".($w * 2)."x".($h * 2)." rgba:- $QUANTIZE -quality 00 png32:\Q$other\E~"
176 die "$other~ has zero size, aborting." unless -s "$other~"; 175 die "$other~ has zero size, aborting." unless -s "$other~";
177 rename "$other~", $other; 176 rename "$other~", $other;
178 }; 177 };
179 } 178 }
180 179
181 warn "scaled down $path to $other\n";#d# 180 #warn "scaled down $path to $other\n";#d#
182
183 push @png, [$other, !$CACHE]; 181 push @png, [$other, !$CACHE];
184 } 182 }
185 } 183 }
186 184
187 (my $face = $stem) =~ s/^.*\///; 185 (my $face = $stem) =~ s/^.*\///;
188 186
187 # split all bigfaces, but avoid smoothfaces (*_S)
189 if (($w > $T || $h > $T) && $face !~ /_S\./) { 188 if (($w > $T || $h > $T) && $face !~ /_S\./) {
190 # split 189 # split
191 my @tile; 190 my @tile;
192 for my $x (0 .. (int $w / $T) - 1) { 191 for my $x (0 .. (int $w / $T) - 1) {
193 for my $y (0 .. (int $h / $T) - 1) { 192 for my $y (0 .. (int $h / $T) - 1) {
308 $info->{visibility} = $visibility if defined $visibility; 307 $info->{visibility} = $visibility if defined $visibility;
309 $info->{magicmap} = $magicmap if defined $magicmap; 308 $info->{magicmap} = $magicmap if defined $magicmap;
310 } 309 }
311 310
312 if (my $smooth = delete $o->{smoothface}) { 311 if (my $smooth = delete $o->{smoothface}) {
313 my ($face, $smooth) = split /\s+/, $smooth; 312 my %kv =split /\s+/, $smooth;
314 # skip empty_S.x11, it seems to server no purpose whatsoever 313 my $level = $o->{smoothlevel}; #TODO: delete from $o if !gcfclient-support
315 # but increases bandwidth demands and worse. 314 while (my ($face, $smooth) = each %kv) {
316 unless ($smooth eq "empty_S.x11") {
317 $FACEINFO{$face}{smooth} = $smooth; 315 $FACEINFO{$face}{smooth} = $smooth;
316 $FACEINFO{$face}{smoothlevel} = $level;
318 } 317 }
319 } 318 }
320 } 319 }
321 } 320 }
322 } 321 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines