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.85 by root, Fri May 14 22:56:47 2010 UTC vs.
Revision 1.86 by root, Tue Oct 5 22:33:10 2010 UTC

174 our $c_trs = new Coro::Channel; 174 our $c_trs = new Coro::Channel;
175 our $c_res = new Coro::Channel; 175 our $c_res = new Coro::Channel;
176 176
177 our @c_png; 177 our @c_png;
178 178
179 sub commit_png($$$) { 179 sub commit_png($$$$) {
180 my ($name, $data, $T) = @_; 180 my ($stem, $name, $data, $T) = @_;
181 181
182 $FACEINFO{$name}{"stem"} = substr $stem, 1 + length $PATH;
182 $FACEINFO{$name}{"data$T"} = $data; 183 $FACEINFO{$name}{"data$T"} = $data;
183 } 184 }
184 185
185 sub process_png { 186 sub process_png {
186 while (@c_png) { 187 while (@c_png) {
404 405
405 if (0 > aio_load $file, $tile) { 406 if (0 > aio_load $file, $tile) {
406 die "$path: unable to read tile +$x+$y, aborting.\n"; 407 die "$path: unable to read tile +$x+$y, aborting.\n";
407 } 408 }
408 IO::AIO::aio_unlink $file unless $CACHE; 409 IO::AIO::aio_unlink $file unless $CACHE;
409 commit_png $x|$y ? "$face+$x+$y" : $face, $tile, $T; 410 commit_png $stem, $x|$y ? "$face+$x+$y" : $face, $tile, $T;
410 } 411 }
411 } else { 412 } else {
412 # use as-is (either small, use smooth) 413 # use as-is (either small, use smooth)
413 commit_png $face, $png, $T; 414 commit_png $stem, $face, $png, $T;
414 } 415 }
415 416
416 aio_unlink $path if $delete; 417 aio_unlink $path if $delete;
417 } 418 }
418 } 419 }
433 434
434 $o->{editor_folder} ||= "\x00$dir"; # horrible kludge 435 $o->{editor_folder} ||= "\x00$dir"; # horrible kludge
435 436
436 my $visibility = delete $o->{visibility}; 437 my $visibility = delete $o->{visibility};
437 my $magicmap = delete $o->{magicmap}; 438 my $magicmap = delete $o->{magicmap};
439 my $glyph = delete $o->{glyph};
438 440
439 # find upper left corner :/ 441 # find upper left corner :/
440 # omg, this is sooo broken 442 # omg, this is sooo broken
441 my ($dx, $dy); 443 my ($dx, $dy);
442 for (my $o = $o; $o; $o = $o->{more}) { 444 for (my $o = $o; $o; $o = $o->{more}) {
452 454
453 $o->{face} .= $ext unless /^blank.x11$|^empty.x11$/ || !$o->{face}; 455 $o->{face} .= $ext unless /^blank.x11$|^empty.x11$/ || !$o->{face};
454 456
455 $visibility = delete $o->{visibility} if exists $o->{visibility}; 457 $visibility = delete $o->{visibility} if exists $o->{visibility};
456 $magicmap = delete $o->{magicmap} if exists $o->{magicmap}; 458 $magicmap = delete $o->{magicmap} if exists $o->{magicmap};
459 $glyph = delete $o->{glyph} if exists $o->{glyph};
457 460
458 my $anim = delete $o->{anim}; 461 my $anim = delete $o->{anim};
459 462
460 if ($anim) { 463 if ($anim) {
461 # possibly add $ext to the animation name to avoid 464 # possibly add $ext to the animation name to avoid
492 495
493 next if $face =~ /^blank.x11$|^empty.x11$/; 496 next if $face =~ /^blank.x11$|^empty.x11$/;
494 497
495 $info->{visibility} = $visibility if defined $visibility; 498 $info->{visibility} = $visibility if defined $visibility;
496 $info->{magicmap} = $magicmap if defined $magicmap; 499 $info->{magicmap} = $magicmap if defined $magicmap;
500 $info->{glyph} = $glyph if defined $glyph;
497 } 501 }
498 502
499 if (my $smooth = delete $o->{smoothface}) { 503 if (my $smooth = delete $o->{smoothface}) {
500 my %kv = split /\s+/, $smooth; 504 my %kv = split /\s+/, $smooth;
501 my $level = $o->{smoothlevel}; #TODO: delete from $o if !gcfclient-support 505 my $level = $o->{smoothlevel}; #TODO: delete from $o if !gcfclient-support
796 make_hash $k, $v->{data64}, $v->{hash64}; 800 make_hash $k, $v->{data64}, $v->{hash64};
797 801
798 #length $v->{data32} <= 10000 or warn "$k: face32 larger than 10000 bytes, will not work with crossfire client.\n"; 802 #length $v->{data32} <= 10000 or warn "$k: face32 larger than 10000 bytes, will not work with crossfire client.\n";
799 #length $v->{data64} <= 10000 or warn "$k: face64 larger than 10000 bytes.\n"; 803 #length $v->{data64} <= 10000 or warn "$k: face64 larger than 10000 bytes.\n";
800 804
805 my $stem = delete $v->{stem};
806 $v->{glyph} //= substr $stem, 0, 1;
807
801 if (my $magicmap = $v->{magicmap}) { 808 if (my $magicmap = $v->{magicmap}) {
802 $magicmap =~ y/A-Z_\-/a-z/d; 809 $magicmap =~ y/A-Z_\-/a-z/d;
803 $v->{magicmap} = $COLOR{$magicmap}; 810 $v->{magicmap} = $COLOR{$magicmap};
804 } 811 }
805 812

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines