| 1 |
#!/usr/bin/env perl |
| 2 |
|
| 3 |
use warnings; |
| 4 |
|
| 5 |
# This script lists tiles which are not even loaded by tiledefs. This implies |
| 6 |
# being unused, although the converse is not true: tiles not listed by this |
| 7 |
# script have an enum and are included in textures, but that enum might be |
| 8 |
# never referenced anywhere. |
| 9 |
# |
| 10 |
# The logic for the UNUSED/ dir is reversed. |
| 11 |
|
| 12 |
for (qw(feat floor gui icons main player wall)) |
| 13 |
{ |
| 14 |
open IN, "<", "rltiles/$_.d" or die "Tiledefs must be built.\n"; |
| 15 |
for (<IN>) |
| 16 |
{ |
| 17 |
next unless m{^ (.+\.png) \\$}; |
| 18 |
$used{$1}++; |
| 19 |
} |
| 20 |
close IN; |
| 21 |
} |
| 22 |
|
| 23 |
open IN, "-|", 'cd rltiles && git ls-files' or die "Can't read ls-files.\n"; |
| 24 |
for (<IN>) |
| 25 |
{ |
| 26 |
chomp; |
| 27 |
next unless /\.png$/; |
| 28 |
print "$_\n" unless !$used{$_} != !/^UNUSED/; |
| 29 |
} |
| 30 |
close IN; |