summaryrefslogtreecommitdiff
path: root/bin/dat2hackvr.pl
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2019-02-05 21:48:29 -0600
committerepoch <epoch@hacking.allowed.org>2019-02-05 21:48:29 -0600
commit420eeee620a287ac5bf133f8a17329a7182d5bbf (patch)
tree407cd59748e0e5ef4f88b15305dd303aa64cf8da /bin/dat2hackvr.pl
parent848a823b1287d8804e8d6170c3ca30ccf7689784 (diff)
downloadhackvr-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-xbin/dat2hackvr.pl34
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;
+ }
+}