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.59 by root, Tue Aug 21 20:00:18 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" };
174 173
175 (my $base = $stem) =~ s/^.*\///; 174 (my $base = $stem) =~ s/^.*\///;
176 175
177 my $fi = $FACEINFO{$base}; 176 my $fi = $FACEINFO{$base};
178 unless ($fi) { 177 unless ($fi) {
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 = $fi->{arc} || { };
184 or die "FATAL: internal error, cannot continue";
185 183
186 unless ($path =~ /~$/) { 184 unless ($path =~ /~$/) {
187 # possibly enlarge 185 # possibly enlarge
188 if (0 > aio_stat "$stem.64x64.png") { 186 if (0 > aio_stat "$stem.64x64.png") {
189 my $other = "$stem.64x64.png~"; 187 my $other = "$stem.64x64.png~";
199 my ($wall_pfx, $wall_dir, $wall_sfx); 197 my ($wall_pfx, $wall_dir, $wall_sfx);
200 198
201 if ( 199 if (
202 !$is_floor 200 !$is_floor
203 && !$arc->{alive} 201 && !$arc->{alive}
204 && $arc->{no_pass} 202 && $arc->{move_block} eq "all"
205 && $path =~ /^(.*_)([0-9A-F])(\.x11.*\.png)$/ 203 && $path =~ /^(.*_)([0-9A-F])(\.x11.*\.png)$/
206 ) { 204 ) {
207 ($wall_pfx, $wall_dir, $wall_sfx) = ($1, hex $2, $3); 205 ($wall_pfx, $wall_dir, $wall_sfx) = ($1, hex $2, $3);
208 206
209 unless (grep { !-e sprintf "%s%X%s", $wall_pfx, $_, $wall_sfx } 0..15) { 207 unless (grep { !-e sprintf "%s%X%s", $wall_pfx, $_, $wall_sfx } 0..15) {
426 facings => $facings, 424 facings => $facings,
427 frames => \@frames, 425 frames => \@frames,
428 }; 426 };
429 } 427 }
430 428
431 for my $face ($o->{face} || (), @{$anim || []}) { 429 for ($o->{face} || (), @{$anim || []}) {
432 next if $face =~ /^facings\s|^blank.x11$|^empty.x11$/; 430 next if /^facings\s/;
433 431
432 my $face = $_;
433 $face =~ s/\+\d+\+\d+$//; # remove tile offset coordinates
434
434 my $info = $FACEINFO{$face} ||= {}; 435 my $info = $FACEINFO{$face} ||= { };
435
436 $info->{arc} = $o; 436 $info->{arc} = $o;
437
438 next if $face =~ /^blank.x11$|^empty.x11$/;
439
437 $info->{visibility} = $visibility if defined $visibility; 440 $info->{visibility} = $visibility if defined $visibility;
438 $info->{magicmap} = $magicmap if defined $magicmap; 441 $info->{magicmap} = $magicmap if defined $magicmap;
439 } 442 }
440 443
441 if (my $smooth = delete $o->{smoothface}) { 444 if (my $smooth = delete $o->{smoothface}) {
519 substr $dir, 0, 1 + length $PATH, ""; 522 substr $dir, 0, 1 + length $PATH, "";
520 523
521 $RESOURCE{"$dir/$file"} = { 524 $RESOURCE{"$dir/$file"} = {
522 type => (delete $meta->{type}) || $type, 525 type => (delete $meta->{type}) || $type,
523 data => $data, 526 data => $data,
524 chksum => (Digest::MD5::md5 $data),
525 %$meta ? (meta => $meta) : (), 527 %$meta ? (meta => $meta) : (),
526 }; 528 };
527 } 529 }
528 } 530 }
529 531
679 length $v->{data64} or warn "$k: face has no png64. this will not work very well.\n"; 681 length $v->{data64} or warn "$k: face has no png64. this will not work very well.\n";
680 682
681 length $v->{data32} <= 10000 or warn "$k: face32 larger than 10000 bytes, will not work with crossfire client.\n"; 683 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"; 684 #length $v->{data64} <= 10000 or warn "$k: face64 larger than 10000 bytes.\n";
683 685
684 $v->{chksum32} = Digest::MD5::md5 $v->{data32};
685 $v->{chksum64} = Digest::MD5::md5 $v->{data64};
686
687 if (my $magicmap = $v->{magicmap}) { 686 if (my $magicmap = $v->{magicmap}) {
688 $magicmap =~ y/A-Z_\-/a-z/d; 687 $magicmap =~ y/A-Z_\-/a-z/d;
689 $v->{magicmap} = $COLOR{$magicmap}; 688 $v->{magicmap} = $COLOR{$magicmap};
690 } 689 }
691 690

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines