diff options
author | Irene Knapp <ireneista@gmail.com> | 2020-05-19 14:39:49 -0700 |
---|---|---|
committer | Irene Knapp <ireneista@gmail.com> | 2020-05-19 14:39:49 -0700 |
commit | 539111f252a647d9580dd01399f00d5f31fba582 (patch) | |
tree | 688304b9506232f2a687154358c134db7fa244c2 /src/fixbitmaps.pl |
Initial, from oneko-1.2.sakura.5
Diffstat (limited to 'src/fixbitmaps.pl')
-rwxr-xr-x | src/fixbitmaps.pl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/fixbitmaps.pl b/src/fixbitmaps.pl new file mode 100755 index 0000000..36f4f8c --- /dev/null +++ b/src/fixbitmaps.pl @@ -0,0 +1,26 @@ +#!/usr/contributed/bin/perl +foreach $elem( @ARGV) { + if ($elem =~ /\.xbm$/io) { + rename ($elem, $elem . '.bak'); + open (OUTFILE, ">$elem"); + $oldfile = $elem . '.bak'; + open (INFILE, $oldfile); + print "Working on $elem\n"; + @data = <INFILE>; + $name = $elem; + $name =~ s/\.xbm$//; + @parts = split(/\//,$name); + $count = @parts; + $name = @parts[$count - 1]; + print "name = $name count = $count\n"; + foreach $line (@data) { + $line =~ s/ \S*width/' ' . $name . '_width'/e; + $line =~ s/ \S*height/' ' . $name . '_height'/e; + $line =~ s/ \S*x_hot/' ' . $name . '_x_hot'/e; + $line =~ s/ \S*y_hot/' ' . $name . '_y_hot'/e; + $line =~ s/ \S*bits/' ' . $name . '_bits'/e; + } + print OUTFILE @data; + unlink ($oldfile); + } +} |