… | |
… | |
191 | while (@arc) { |
191 | while (@arc) { |
192 | my ($dir, $file) = @{pop @arc}; |
192 | my ($dir, $file) = @{pop @arc}; |
193 | |
193 | |
194 | my $arc; |
194 | my $arc; |
195 | aio_load "$dir/$file", $arc; # simply pre-cache, as read_arch wants a file :/ |
195 | aio_load "$dir/$file", $arc; # simply pre-cache, as read_arch wants a file :/ |
|
|
196 | |
196 | my $arc = read_arch "$dir/$file"; |
197 | my $arc = read_arch "$dir/$file"; |
|
|
198 | for my $o (values %$arc) { |
|
|
199 | push @ARC, $o; |
|
|
200 | my ($dx, $dy); |
|
|
201 | # omg, this is sooo broken |
|
|
202 | for (my $o = $o; $o; $o = $o->{more}) { |
|
|
203 | $dx = $o->{x} if $o->{x} < $dx; |
|
|
204 | $dy = $o->{y} if $o->{y} < $dy; |
|
|
205 | } |
|
|
206 | for (my $o = $o; $o; $o = $o->{more}) { |
|
|
207 | my $x = $o->{x} - $dx; |
|
|
208 | my $y = $o->{y} - $dy; |
|
|
209 | if ($x|$y) { |
|
|
210 | $_ .= "+$x+$y" for $o->{face}, @{$o->{anim} || []}; |
|
|
211 | } |
|
|
212 | } |
|
|
213 | } |
197 | } |
214 | } |
198 | } |
215 | } |
199 | |
216 | |
200 | sub process_trs { |
217 | sub process_trs { |
201 | while (@trs) { |
218 | while (@trs) { |
… | |
… | |
245 | (async \&process_png), (async \&process_png), |
262 | (async \&process_png), (async \&process_png), |
246 | (async \&process_trs), (async \&process_trs), |
263 | (async \&process_trs), (async \&process_trs), |
247 | (async \&process_arc), (async \&process_arc), |
264 | (async \&process_arc), (async \&process_arc), |
248 | ); |
265 | ); |
249 | |
266 | |
|
|
267 | open my $archetypes, ">:utf8", "$DATADIR/archetypes~" |
|
|
268 | or die "$DATADIR/archetypes~: $!"; |
|
|
269 | print $archetypes Crossfire::archlist_to_string \@ARC; |
|
|
270 | close $archetypes; |
|
|
271 | rename "$DATADIR/archetypes~", "$DATADIR/archetypes"; |
|
|
272 | |
250 | die "--install-arch not yet implemented\n"; |
273 | die "--install-arch not fully implemented\n"; |
251 | } |
274 | } |
252 | } |
275 | } |
253 | |
276 | |
254 | Getopt::Long::Configure ("bundling", "no_ignore_case"); |
277 | Getopt::Long::Configure ("bundling", "no_ignore_case"); |
255 | GetOptions ( |
278 | GetOptions ( |