summaryrefslogtreecommitdiff
path: root/tools/dat2hackvr.pl
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2016-12-09 15:54:33 -0600
committerepoch <epoch@hacking.allowed.org>2016-12-09 15:54:33 -0600
commitb4dddad64122649d9da6340032275d1756930e74 (patch)
treeafcfff52545fce1c7713f24e7a28904230fa8671 /tools/dat2hackvr.pl
parentfa1b447ef684e5eadda27d8870de6a6e09292a18 (diff)
downloadhackvr-b4dddad64122649d9da6340032275d1756930e74.tar.gz
hackvr-b4dddad64122649d9da6340032275d1756930e74.zip
LOTS OF SHIT
Diffstat (limited to 'tools/dat2hackvr.pl')
-rwxr-xr-xtools/dat2hackvr.pl34
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;
+ }
+}