diff options
author | epoch <epoch@hacking.allowed.org> | 2016-12-09 15:54:33 -0600 |
---|---|---|
committer | epoch <epoch@hacking.allowed.org> | 2016-12-09 15:54:33 -0600 |
commit | b4dddad64122649d9da6340032275d1756930e74 (patch) | |
tree | afcfff52545fce1c7713f24e7a28904230fa8671 /tools/dat2hackvr.pl | |
parent | fa1b447ef684e5eadda27d8870de6a6e09292a18 (diff) | |
download | hackvr-b4dddad64122649d9da6340032275d1756930e74.tar.gz hackvr-b4dddad64122649d9da6340032275d1756930e74.zip |
LOTS OF SHIT
Diffstat (limited to 'tools/dat2hackvr.pl')
-rwxr-xr-x | tools/dat2hackvr.pl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/dat2hackvr.pl b/tools/dat2hackvr.pl new file mode 100755 index 0000000..2a2fbe1 --- /dev/null +++ b/tools/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 "; + print $line . " 0 " . $prev . " 0"; + print "\n"; + } + $prev=""; + } + if($first eq "") { + $first=$line; + } + $prev=$line; + } +} |