|
|
@ -10,6 +10,7 @@ using namespace std;
|
|
|
|
#include <xgetopt.h>
|
|
|
|
#include <xgetopt.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "termutil.h"
|
|
|
|
|
|
|
|
|
|
|
|
bool parseOptions(int argc, char **argv,
|
|
|
|
bool parseOptions(int argc, char **argv,
|
|
|
|
bool &trees, bool &shrubs, bool &immolate)
|
|
|
|
bool &trees, bool &shrubs, bool &immolate)
|
|
|
@ -52,6 +53,7 @@ bool parseOptions(int argc, char **argv,
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
bool temporary_terminal = TemporaryTerminal();
|
|
|
|
bool all_trees = false;
|
|
|
|
bool all_trees = false;
|
|
|
|
bool all_shrubs = false;
|
|
|
|
bool all_shrubs = false;
|
|
|
|
bool immolate = false;
|
|
|
|
bool immolate = false;
|
|
|
@ -68,9 +70,8 @@ int main(int argc, char *argv[])
|
|
|
|
if (!context->Attach())
|
|
|
|
if (!context->Attach())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::cerr << "Unable to attach to DF!" << std::endl;
|
|
|
|
std::cerr << "Unable to attach to DF!" << std::endl;
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
if(temporary_terminal)
|
|
|
|
std::cin.ignore();
|
|
|
|
std::cin.ignore();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -79,9 +80,8 @@ int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::cerr << "Cannot get map info!" << std::endl;
|
|
|
|
std::cerr << "Cannot get map info!" << std::endl;
|
|
|
|
context->Detach();
|
|
|
|
context->Detach();
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
if(temporary_terminal)
|
|
|
|
std::cin.ignore();
|
|
|
|
std::cin.ignore();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DFHack::Gui * Gui = context->getGui();
|
|
|
|
DFHack::Gui * Gui = context->getGui();
|
|
|
@ -92,6 +92,8 @@ int main(int argc, char *argv[])
|
|
|
|
if (!veg->Start(vegCount))
|
|
|
|
if (!veg->Start(vegCount))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::cerr << "Unable to read vegetation!" << std::endl;
|
|
|
|
std::cerr << "Unable to read vegetation!" << std::endl;
|
|
|
|
|
|
|
|
if(temporary_terminal)
|
|
|
|
|
|
|
|
cin.ignore();
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(all_shrubs || all_trees)
|
|
|
|
if(all_shrubs || all_trees)
|
|
|
@ -158,10 +160,10 @@ int main(int argc, char *argv[])
|
|
|
|
veg->Finish();
|
|
|
|
veg->Finish();
|
|
|
|
maps->Finish();
|
|
|
|
maps->Finish();
|
|
|
|
context->Detach();
|
|
|
|
context->Detach();
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
if(temporary_terminal)
|
|
|
|
std::cout << " Press any key to finish.";
|
|
|
|
{
|
|
|
|
std::cin.ignore();
|
|
|
|
std::cout << " Press any key to finish.";
|
|
|
|
#endif
|
|
|
|
std::cin.ignore();
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|