diff options
author | epoch <epoch@hacking.allowed.org> | 2019-02-05 21:48:29 -0600 |
---|---|---|
committer | epoch <epoch@hacking.allowed.org> | 2019-02-05 21:48:29 -0600 |
commit | 420eeee620a287ac5bf133f8a17329a7182d5bbf (patch) | |
tree | 407cd59748e0e5ef4f88b15305dd303aa64cf8da /bin/dat2hackvr.pl | |
parent | 848a823b1287d8804e8d6170c3ca30ccf7689784 (diff) | |
download | hackvr-420eeee620a287ac5bf133f8a17329a7182d5bbf.tar.gz hackvr-420eeee620a287ac5bf133f8a17329a7182d5bbf.zip |
forgot to add bin dir that contains a LOT of the handy stuff
Diffstat (limited to 'bin/dat2hackvr.pl')
-rwxr-xr-x | bin/dat2hackvr.pl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/bin/dat2hackvr.pl b/bin/dat2hackvr.pl new file mode 100755 index 0000000..03c5315 --- /dev/null +++ b/bin/dat2hackvr.pl @@ -0,0 +1,34 @@ +#!/usr/bin/perl + +use strict; + +die "usage: dat2hackvr.pl name file\n" unless $ARGV[0]; + +my $line; +my $prev; +my $first; +open(FILE,$ARGV[1]) if $ARGV[1]; +while($line=<FILE>) { + chomp $line; + if(!($line =~ m/^#/)) { + if($line eq "") { +# print $ARGV[0]; +# print " addtriangle "; +# print $prev . " 0 " . $first . " 0 " . $first . " 0"; +# print "\n"; + $first=""; + } else { + if($prev ne "") { + print $ARGV[0]; + print " addshape 2 2 "; + print $line . " 0 " . $prev . " 0"; + print "\n"; + } + $prev=""; + } + if($first eq "") { + $first=$line; + } + $prev=$line; + } +} |