From 3ec84b5f7c7cdc50fa1c75cf838bbb982acc4349 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Tue, 19 May 2020 21:54:39 -0700 Subject: Import oneko-1.2.sakura.5 unchanged, from 1999. --- fixbitmaps.pl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 fixbitmaps.pl (limited to 'fixbitmaps.pl') diff --git a/fixbitmaps.pl b/fixbitmaps.pl new file mode 100755 index 0000000..36f4f8c --- /dev/null +++ b/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 = ; + $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); + } +} -- cgit 1.4.1