Ticket #5008: variant_support.diff

File variant_support.diff, 1.3 KB (added by Stan, 6 years ago)

This patch makes variant part of the script.

  • checkrefs.pl

     
    147147    }
    148148}
    149149
     150
     151sub 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
    150177sub add_art
    151178{
    152179    print "Loading art files...\n";
     
    553580
    554581add_actors();
    555582
     583add_variants();
     584
    556585add_art();
    557586
    558587add_materials();