Fixes and improves terrain scanning of checkrefs.pl.

Removes some useless old actors.

This was SVN commit r13695.
This commit is contained in:
historic_bruno 2013-08-18 01:57:37 +00:00
parent a18262e7b1
commit 791d392797
8 changed files with 35 additions and 100 deletions

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant>
<mesh>test/arch_1520.dae</mesh>
<textures><texture file="temp/test.dds" name="baseTex"/></textures>
</variant>
</group>
</actor>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant>
<mesh>test/arch_160.dae</mesh>
<textures><texture file="temp/test.dds" name="baseTex"/></textures>
</variant>
</group>
</actor>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant>
<mesh>test/arch_160.dae</mesh>
<textures><texture file="temp/test.dds" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans.xml</material>
</actor>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant>
<mesh>test/arch_3040.dae</mesh>
<textures><texture file="temp/test.dds" name="baseTex"/></textures>
</variant>
</group>
</actor>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant>
<mesh>test/arch_320.dae</mesh>
<textures><texture file="temp/test.dds" name="baseTex"/></textures>
</variant>
</group>
</actor>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant>
<mesh>test/arch_320.dae</mesh>
<textures><texture file="temp/test.dds" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans.xml</material>
</actor>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant>
<mesh>test/arch_5760.dae</mesh>
<textures><texture file="temp/test.dds" name="baseTex"/></textures>
</variant>
</group>
</actor>

View File

@ -212,11 +212,16 @@ sub add_scenarios_pmp
# Need to generate terrain texture filename=>path lookup first
my %terrains;
for my $f (find_files('art/textures/terrain/types', 'dds|png|jpg|tga'))
for my $f (find_files('art/terrains', 'xml'))
{
$f =~ /([^\/]+)\.(dds|png|jpg|tga)/ or die;
warn "Duplicate terrain name '$1' (from '$terrains{$1}' and '$f')\n" if $terrains{$1};
$terrains{$1} = $f;
$f =~ /([^\/]+)\.xml/ or die;
# ignore terrains.xml
if ($f !~ /terrains.xml$/)
{
warn "Duplicate terrain name '$1' (from '$terrains{$1}' and '$f')\n" if $terrains{$1};
$terrains{$1} = $f;
}
}
my @mapfiles = find_files('maps/scenarios', 'pmp');
@ -256,7 +261,7 @@ sub add_scenarios_pmp
my $str;
read $fh, $str, $len;
push @deps, [ $f, $terrains{$str} || "art/textures/terrain/types/(unknown)/$str" ];
push @deps, [ $f, $terrains{$str} || "art/terrains/(unknown)/$str" ];
}
# ignore patches data
@ -405,6 +410,29 @@ sub add_rms
}
}
sub add_terrains
{
print "Loading terrains...\n";
my @terrains = find_files('art/terrains', 'xml');
for my $f (sort @terrains)
{
# ignore terrains.xml
if ($f !~ /terrains.xml$/)
{
push @files, $f;
my $terrain = XMLin(vfs_to_physical($f), ForceArray => [qw(texture)], KeyAttr => []) or die "Failed to parse '$f': $!";
for my $texture (@{$terrain->{textures}{texture}})
{
push @deps, [ $f, "art/textures/terrain/$texture->{file}" ] if $texture->{file};
}
push @deps, [ $f, "art/materials/$terrain->{material}" ] if $terrain->{material};
}
}
}
sub check_deps
{
@ -486,6 +514,8 @@ add_civs();
add_rms();
add_terrains();
# TODO: add non-skin textures, and all the references to them
print "\n";