| 150 | |
| 151 | sub add_variants |
| 152 | { |
| 153 | print "Loading variants...\n"; |
| 154 | my @variantfiles = find_files('art/variants', 'xml'); |
| 155 | |
| 156 | for my $f (sort @variantfiles) |
| 157 | { |
| 158 | push @files, $f; |
| 159 | push @roots, $f if ROOT_ACTORS; |
| 160 | my $variant = XMLin(vfs_to_physical($f), ForceArray => [qw(texture prop animation)], KeyAttr => []) or die "Failed to parse '$f': $!"; |
| 161 | push @deps, [ $f, "art/meshes/$variant->{mesh}" ] if $variant->{mesh}; |
| 162 | for my $tex (@{$variant->{textures}{texture}}) |
| 163 | { |
| 164 | push @deps, [ $f, "art/textures/skins/$tex->{file}" ] if $tex->{file}; |
| 165 | } |
| 166 | for my $prop (@{$variant->{props}{prop}}) |
| 167 | { |
| 168 | push @deps, [ $f, "art/actors/$prop->{actor}" ] if $prop->{actor}; |
| 169 | } |
| 170 | for my $anim (@{$variant->{animations}{animation}}) |
| 171 | { |
| 172 | push @deps, [ $f, "art/animation/$anim->{file}" ] if $anim->{file}; |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | |