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.54 by root, Sun Aug 19 10:28:52 2007 UTC vs.
Revision 1.57 by root, Mon Aug 20 22:09:04 2007 UTC

21use Crossfire; 21use Crossfire;
22use Coro; 22use Coro;
23use Coro::AIO; 23use Coro::AIO;
24use Coro::Util; 24use Coro::Util;
25use POSIX (); 25use POSIX ();
26use Digest::MD5;
27use Carp; 26use Carp;
28use Coro::Channel; 27use Coro::Channel;
29use Coro::Storable; $Storable::canonical = 1; 28use Coro::Storable; $Storable::canonical = 1;
30 29
31$SIG{QUIT} = sub { Carp::cluck "QUIT" }; 30$SIG{QUIT} = sub { Carp::cluck "QUIT" };
179 warn "$path: <$base> not referenced by any archetype, skipping.\n"; 178 warn "$path: <$base> not referenced by any archetype, skipping.\n";
180 next; 179 next;
181 } 180 }
182 181
183 my $arc = $FACEINFO{$base}{arc} 182 my $arc = $FACEINFO{$base}{arc}
184 or die "FATAL: internal error, cannot continue"; 183 or die "FATAL: internal error <$base>, cannot continue";
185 184
186 unless ($path =~ /~$/) { 185 unless ($path =~ /~$/) {
187 # possibly enlarge 186 # possibly enlarge
188 if (0 > aio_stat "$stem.64x64.png") { 187 if (0 > aio_stat "$stem.64x64.png") {
189 my $other = "$stem.64x64.png~"; 188 my $other = "$stem.64x64.png~";
199 my ($wall_pfx, $wall_dir, $wall_sfx); 198 my ($wall_pfx, $wall_dir, $wall_sfx);
200 199
201 if ( 200 if (
202 !$is_floor 201 !$is_floor
203 && !$arc->{alive} 202 && !$arc->{alive}
204 && $arc->{no_pass} 203 && $arc->{move_block} eq "all"
205 && $path =~ /^(.*_)([0-9A-F])(\.x11.*\.png)$/ 204 && $path =~ /^(.*_)([0-9A-F])(\.x11.*\.png)$/
206 ) { 205 ) {
207 ($wall_pfx, $wall_dir, $wall_sfx) = ($1, hex $2, $3); 206 ($wall_pfx, $wall_dir, $wall_sfx) = ($1, hex $2, $3);
208 207
209 unless (grep { !-e sprintf "%s%X%s", $wall_pfx, $_, $wall_sfx } 0..15) { 208 unless (grep { !-e sprintf "%s%X%s", $wall_pfx, $_, $wall_sfx } 0..15) {
427 frames => \@frames, 426 frames => \@frames,
428 }; 427 };
429 } 428 }
430 429
431 for my $face ($o->{face} || (), @{$anim || []}) { 430 for my $face ($o->{face} || (), @{$anim || []}) {
432 next if $face =~ /^facings\s|^blank.x11$|^empty.x11$/; 431 next if $face =~ /^facings\s/;
433 432
434 my $info = $FACEINFO{$face} ||= {}; 433 my $info = $FACEINFO{$face} ||= { };
435
436 $info->{arc} = $o; 434 $info->{arc} = $o;
435
436 next if $face =~ /^blank.x11$|^empty.x11$/;
437
437 $info->{visibility} = $visibility if defined $visibility; 438 $info->{visibility} = $visibility if defined $visibility;
438 $info->{magicmap} = $magicmap if defined $magicmap; 439 $info->{magicmap} = $magicmap if defined $magicmap;
439 } 440 }
440 441
441 if (my $smooth = delete $o->{smoothface}) { 442 if (my $smooth = delete $o->{smoothface}) {
519 substr $dir, 0, 1 + length $PATH, ""; 520 substr $dir, 0, 1 + length $PATH, "";
520 521
521 $RESOURCE{"$dir/$file"} = { 522 $RESOURCE{"$dir/$file"} = {
522 type => (delete $meta->{type}) || $type, 523 type => (delete $meta->{type}) || $type,
523 data => $data, 524 data => $data,
524 chksum => (Digest::MD5::md5 $data),
525 %$meta ? (meta => $meta) : (), 525 %$meta ? (meta => $meta) : (),
526 }; 526 };
527 } 527 }
528 } 528 }
529 529
679 length $v->{data64} or warn "$k: face has no png64. this will not work very well.\n"; 679 length $v->{data64} or warn "$k: face has no png64. this will not work very well.\n";
680 680
681 length $v->{data32} <= 10000 or warn "$k: face32 larger than 10000 bytes, will not work with crossfire client.\n"; 681 length $v->{data32} <= 10000 or warn "$k: face32 larger than 10000 bytes, will not work with crossfire client.\n";
682 #length $v->{data64} <= 10000 or warn "$k: face64 larger than 10000 bytes.\n"; 682 #length $v->{data64} <= 10000 or warn "$k: face64 larger than 10000 bytes.\n";
683 683
684 $v->{chksum32} = Digest::MD5::md5 $v->{data32};
685 $v->{chksum64} = Digest::MD5::md5 $v->{data64};
686
687 if (my $magicmap = $v->{magicmap}) { 684 if (my $magicmap = $v->{magicmap}) {
688 $magicmap =~ y/A-Z_\-/a-z/d; 685 $magicmap =~ y/A-Z_\-/a-z/d;
689 $v->{magicmap} = $COLOR{$magicmap}; 686 $v->{magicmap} = $COLOR{$magicmap};
690 } 687 }
691 688

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines