#!/usr/bin/perl -w

# (c) Copyright by Tels 1999. All Rights Reserved.

use Cowgen::Bunch;   # for a bunch of brushes
use Cowgen::Dromed;  # for some Thief constants and specifics
use Cowgen::Texture; # for texture name<=>number mapping
use Cowgen::Vbr;     # loadMission

print "Demo script: Shows you optimizations.\n\n";

# get commandline parameter
$infile = shift || "data/unopt.mis";
$outfile = shift || "data/optimal.mis";

$time = time; # get now
my ($vbr,$gf,$bunch,$txt) = Cowgen::Vbr::loadMission ($infile,"");

$bunch->debug(); # be talkative

$bunch->autoRoom();
$bunch->optimize();
$list = { $txt->texture("winw1264") => 1, 
          $txt->texture("win6241") => 1, $txt->texture("win6231") => 1,
          $txt->texture("win3251") => 1, $txt->texture("dortop") => 1,
          $txt->texture("criso6br") => 1, $txt->texture("plain") => 1,
  };
#$bunch->alignTextures($list,1);
$bunch->alignTextures();

$vbr->missionEAX ( eax => eax_stoneRoom() );
$vbr->renderParams ( ambient => 20 ); # always use this!
$vbr->saveMission($gf,$bunch,$outfile);

$seconds = (time-$time) || 1;
print "Done. Took $seconds seconds.\n";

# EOF

