#!/usr/bin/perl -w

# (c) Copyright by Tels 1999. All Rights Reserved.
# Try "perl houses houses.txt" and then "perl txt2vbr houses.txt" then load
# houses.mis and houses.vbr into DromEd. Enjoy!

use Cowgen::Bunch;  # for a bunch of brushes
use Cowgen::Dromed; # for some Thief constants and specifics
use Cowgen::Vbr;

print "Convert a TXT file (written by genvbr) back to a VBR file\n\n";
print "Usage: perl txt2vbr infile[.txt] [outfile[.vbr|.mis]]\n\n";

$infile = shift || "dummy.txt";
$infile =~ s/\.txt$//;
$outfile = shift || $infile;
$outfile .= ".vbr" if ($outfile !~ /\.(vbr|mis)$/);
$infile .= ".txt";

print "Converting $infile to $outfile...\n";

print "Stage 1 - reading in text...\n";
$bunch = Cowgen::Bunch->create ("name",$infile);
print "Stage 2 - writing out VBR...\n";
$vbr->missionEAX ( eax => eax_stoneRoom() );
$vbr->saveMission($gf,$bunch,$outfile);
print "\nDone.\n";

# EOF

