Move grow and immolate to supported.

develop
Petr Mrázek 2011-05-15 06:25:19 +02:00
parent ca65aa99e6
commit bba5f0884d
4 changed files with 32 additions and 27 deletions

@ -19,12 +19,6 @@ ENDIF()
# a creature mood dump hack. has hardcoded offsets # a creature mood dump hack. has hardcoded offsets
DFHACK_TOOL(dfmoodump moodump.cpp) DFHACK_TOOL(dfmoodump moodump.cpp)
# burn trees and shrubs to ashes
DFHACK_TOOL(dfimmolate immolate.cpp)
# grow saplings into trees instantly
DFHACK_TOOL(dfgrow grow.cpp)
# bauxite - turn all mechanisms into bauxite mechanisms # bauxite - turn all mechanisms into bauxite mechanisms
# Author: Alex Legg # Author: Alex Legg
# FIXME: turned off. there is no reliable Items module. # FIXME: turned off. there is no reliable Items module.

@ -14,6 +14,12 @@ IF(MSVC)
set(LOCAL_DEPNAME memxml-for-supported) set(LOCAL_DEPNAME memxml-for-supported)
ENDIF() ENDIF()
# burn trees and shrubs to ashes
DFHACK_TOOL(dfimmolate immolate.cpp)
# grow saplings into trees instantly
DFHACK_TOOL(dfgrow grow.cpp)
# a reveal clone # a reveal clone
DFHACK_TOOL(dfreveal reveal.cpp) DFHACK_TOOL(dfreveal reveal.cpp)

@ -10,9 +10,11 @@ using namespace std;
#include <xgetopt.h> #include <xgetopt.h>
#include <time.h> #include <time.h>
#include <stdlib.h> #include <stdlib.h>
#include "termutil.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
bool temporary_terminal = TemporaryTerminal();
srand(time(0)); srand(time(0));
uint32_t x_max = 0, y_max = 0, z_max = 0; uint32_t x_max = 0, y_max = 0, z_max = 0;
@ -22,9 +24,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;
} }
@ -33,9 +34,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();
@ -46,6 +46,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;
} }
int32_t x,y,z; int32_t x,y,z;
@ -89,10 +91,11 @@ 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; std::cout << std::endl;
return 0; return 0;
} }

@ -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;
} }