… | |
… | |
20 | use File::Spec::Functions; |
20 | use File::Spec::Functions; |
21 | use File::Basename; |
21 | use File::Basename; |
22 | use File::Path; |
22 | use File::Path; |
23 | use HTTP::Request::Common; |
23 | use HTTP::Request::Common; |
24 | use Cwd 'abs_path'; |
24 | use Cwd 'abs_path'; |
|
|
25 | use strict; |
25 | |
26 | |
26 | our @EXPORT = qw(insert_arch_stack_layer replace_arch_stack_layer new_arch_pb |
27 | our @EXPORT = qw(insert_arch_stack_layer replace_arch_stack_layer new_arch_pb |
27 | fill_pb_from_arch arch_is_floor stack_find_floor stack_find_wall |
28 | fill_pb_from_arch arch_is_floor stack_find_floor stack_find_wall |
28 | stack_find arch_is_wall arch_is_monster add_table_widget quick_msg |
29 | stack_find arch_is_wall arch_is_monster add_table_widget quick_msg |
29 | def arch_is_exit map2abs exit_paths pseudohtml2txt arch_is_connector); |
30 | def arch_is_exit map2abs exit_paths pseudohtml2txt arch_is_connector); |
… | |
… | |
71 | } |
72 | } |
72 | |
73 | |
73 | sub map2abs { |
74 | sub map2abs { |
74 | my ($dest, $mape) = @_; |
75 | my ($dest, $mape) = @_; |
75 | |
76 | |
76 | $mappath = abs_path $mappath; |
77 | $dest = abs_path $dest; |
77 | my $dir; |
78 | my $dir; |
78 | if (File::Spec->file_name_is_absolute($dest)) { |
79 | if (File::Spec->file_name_is_absolute($dest)) { |
79 | $dir = catdir ($::MAPDIR, $dest); |
80 | $dir = catdir ($::MAPDIR, $dest); |
80 | } else { |
81 | } else { |
81 | my ($v, $p, $f) = File::Spec->splitpath ($mape->{path}); |
82 | my ($v, $p, $f) = File::Spec->splitpath ($mape->{path}); |
… | |
… | |
119 | |
120 | |
120 | sub fill_pb_from_arch { |
121 | sub fill_pb_from_arch { |
121 | my ($pb, $a) = @_; |
122 | my ($pb, $a) = @_; |
122 | |
123 | |
123 | my $o = $Crossfire::ARCH{$a->{_name}}; |
124 | my $o = $Crossfire::ARCH{$a->{_name}}; |
124 | my $face = $Crossfire::FACE{$a->{face} || $o->{face} || "blank.111"} |
125 | my $face = $Crossfire::FACE{$a->{face} || $o->{face} || "blank.111"}; |
|
|
126 | unless ($face) { |
|
|
127 | $face = $Crossfire::FACE{"blank.x11"} |
125 | or warn "no gfx found for arch '$a->{_name}' at ($x|$y)\n"; |
128 | or warn "no gfx found for arch '$a->{_name}'\n"; |
|
|
129 | } |
126 | |
130 | |
127 | $face or return; |
131 | $face or return; |
128 | |
132 | |
129 | $pb->fill (0x00000000); |
133 | $pb->fill (0x00000000); |
130 | $TILE->composite ($pb, |
134 | $TILE->composite ($pb, |