diff --git a/library/DFMemInfo.cpp b/library/DFMemInfo.cpp index 8ac0a2c94..76934b5a8 100644 --- a/library/DFMemInfo.cpp +++ b/library/DFMemInfo.cpp @@ -29,6 +29,55 @@ distribution. using namespace DFHack; +/* +* Common data types +*/ +namespace DFHack +{ + struct t_type + { + t_type(uint32_t assign, uint32_t type, std::string classname) + :classname(classname),assign(assign),type(type){}; + std::string classname; + uint32_t assign; + uint32_t type; + }; + + struct t_class + { + t_class(const t_class &old) + { + classname = old.classname; + vtable = old.vtable; + assign = old.assign; + type_offset = old.type_offset; + for(uint32_t i = 0; i < old.subs.size();i++) + { + t_type * t = new t_type (*old.subs[i]); + subs.push_back(t); + } + } + t_class () + { + vtable = 0; + assign = 0; + type_offset = 0; + } + ~t_class() + { + for(uint32_t i = 0; i < subs.size();i++) + { + delete subs[i]; + } + subs.clear(); + } + std::string classname; + uint32_t vtable; + uint32_t assign;// index to typeclass array if multiclass. return value if not. + uint32_t type_offset; // offset of type data for multiclass + std::vector subs; + }; +} /* * Private data */ diff --git a/library/include/DFHack.h b/library/include/DFHack.h index 22a332522..865b12716 100644 --- a/library/include/DFHack.h +++ b/library/include/DFHack.h @@ -1,6 +1,7 @@ #ifndef DFHACK_API_H #define DFHACK_API_H +// DFHack core classes and types #include "dfhack/DFIntegers.h" #include "dfhack/DFGlobal.h" #include "dfhack/DFError.h" @@ -10,7 +11,7 @@ #include "dfhack/DFProcess.h" #include "dfhack/DFTypes.h" - +// DFHack modules #include "dfhack/modules/Buildings.h" #include "dfhack/modules/Materials.h" #include "dfhack/modules/Position.h" @@ -22,5 +23,10 @@ #include "dfhack/modules/Vegetation.h" #include "dfhack/modules/Maps.h" -#include "dfhack/DFMiscUtils.h" +#ifdef DFHACK_WANT_MISCUTILS + #include "dfhack/DFMiscUtils.h" +#endif +#ifdef DFHACK_WANT_TILETYPES + #include "dfhack/DFTileTypes.h" +#endif #endif \ No newline at end of file diff --git a/library/include/DFHack_C.h b/library/include/DFHack_C.h index f08c31131..6c5dd004f 100644 --- a/library/include/DFHack_C.h +++ b/library/include/DFHack_C.h @@ -35,7 +35,7 @@ distribution. #include "dfhack/DFExport.h" #include "dfhack/DFIntegers.h" -using namespace std; + using namespace DFHack; typedef void DFHackObject; diff --git a/library/include/dfhack/DFMemInfo.h b/library/include/dfhack/DFMemInfo.h index 50a4aa55c..941faf6f2 100644 --- a/library/include/dfhack/DFMemInfo.h +++ b/library/include/dfhack/DFMemInfo.h @@ -27,64 +27,13 @@ distribution. #include "DFPragma.h" #include "DFExport.h" -#include -#include -#include - namespace DFHack { /* * Stubs */ - class Process; - - /* - * Common data types - */ - struct t_type - { - t_type(uint32_t assign, uint32_t type, std::string classname) - :classname(classname),assign(assign),type(type){}; - std::string classname; - uint32_t assign; - uint32_t type; - }; - - struct t_class - { - t_class(const t_class &old) - { - classname = old.classname; - vtable = old.vtable; - assign = old.assign; - type_offset = old.type_offset; - for(uint32_t i = 0; i < old.subs.size();i++) - { - t_type * t = new t_type (*old.subs[i]); - subs.push_back(t); - } - } - t_class () - { - vtable = 0; - assign = 0; - type_offset = 0; - } - ~t_class() - { - for(uint32_t i = 0; i < subs.size();i++) - { - delete subs[i]; - } - subs.clear(); - } - std::string classname; - uint32_t vtable; - uint32_t assign;// index to typeclass array if multiclass. return value if not. - uint32_t type_offset; // offset of type data for multiclass - vector subs; - }; + struct t_class; class DFHACK_EXPORT memory_info { @@ -184,7 +133,7 @@ namespace DFHack /** * Get the internal classID->classname mapping (for speed). DO NOT MANIPULATE THE VECTOR! */ - const vector * getClassIDMapping(); + const std::vector * getClassIDMapping(); }; } #endif // MEMINFO_H_INCLUDED diff --git a/library/include/dfhack/DFProcess.h b/library/include/dfhack/DFProcess.h index d2f888492..25ac51997 100644 --- a/library/include/dfhack/DFProcess.h +++ b/library/include/dfhack/DFProcess.h @@ -136,13 +136,13 @@ namespace DFHack virtual void write(uint32_t address, uint32_t length, uint8_t* buffer) = 0; /// read an STL string - virtual const string readSTLString (uint32_t offset) = 0; + virtual const std::string readSTLString (uint32_t offset) = 0; /// read an STL string virtual size_t readSTLString (uint32_t offset, char * buffer, size_t bufcapacity) = 0; /// write an STL string virtual void writeSTLString(const uint32_t address, const std::string writeString) = 0; /// get class name of an object with rtti/type info - virtual string readClassName(uint32_t vptr) = 0; + virtual std::string readClassName(uint32_t vptr) = 0; /// read a null-terminated C string virtual const std::string readCString (uint32_t offset) = 0; @@ -155,9 +155,9 @@ namespace DFHack virtual bool isIdentified() = 0; /// find the thread IDs of the process - virtual bool getThreadIDs(vector & threads ) = 0; + virtual bool getThreadIDs(std::vector & threads ) = 0; /// get virtual memory ranges of the process (what is mapped where) - virtual void getMemRanges( vector & ranges ) = 0; + virtual void getMemRanges(std::vector & ranges ) = 0; /// get the flattened Memory.xml entry of this process virtual memory_info *getDescriptor() = 0; @@ -182,7 +182,7 @@ namespace DFHack private: Private * const d; public: - NormalProcess(uint32_t pid, vector & known_versions); + NormalProcess(uint32_t pid, std::vector & known_versions); ~NormalProcess(); bool attach(); bool detach(); @@ -214,11 +214,11 @@ namespace DFHack void read( uint32_t address, uint32_t length, uint8_t* buffer); void write(uint32_t address, uint32_t length, uint8_t* buffer); - const string readSTLString (uint32_t offset); + const std::string readSTLString (uint32_t offset); size_t readSTLString (uint32_t offset, char * buffer, size_t bufcapacity); void writeSTLString(const uint32_t address, const std::string writeString){}; // get class name of an object with rtti/type info - string readClassName(uint32_t vptr); + std::string readClassName(uint32_t vptr); const std::string readCString (uint32_t offset); @@ -226,8 +226,8 @@ namespace DFHack bool isAttached(); bool isIdentified(); - bool getThreadIDs(vector & threads ); - void getMemRanges( vector & ranges ); + bool getThreadIDs(std::vector & threads ); + void getMemRanges(std::vector & ranges ); memory_info *getDescriptor(); int getPID(); // get module index by name and version. bool 1 = error @@ -246,7 +246,7 @@ namespace DFHack Private * const d; public: - SHMProcess(uint32_t PID, vector & known_versions); + SHMProcess(uint32_t PID, std::vector & known_versions); ~SHMProcess(); // Set up stuff so we can read memory bool attach(); @@ -279,11 +279,11 @@ namespace DFHack void read( uint32_t address, uint32_t length, uint8_t* buffer); void write(uint32_t address, uint32_t length, uint8_t* buffer); - const string readSTLString (uint32_t offset); + const std::string readSTLString (uint32_t offset); size_t readSTLString (uint32_t offset, char * buffer, size_t bufcapacity); void writeSTLString(const uint32_t address, const std::string writeString); // get class name of an object with rtti/type info - string readClassName(uint32_t vptr); + std::string readClassName(uint32_t vptr); const std::string readCString (uint32_t offset); @@ -291,8 +291,8 @@ namespace DFHack bool isAttached(); bool isIdentified(); - bool getThreadIDs(vector & threads ); - void getMemRanges( vector & ranges ); + bool getThreadIDs(std::vector & threads ); + void getMemRanges(std::vector & ranges ); memory_info *getDescriptor(); int getPID(); // get module index by name and version. bool 1 = error @@ -311,7 +311,7 @@ namespace DFHack Private * const d; public: - WineProcess(uint32_t pid, vector & known_versions); + WineProcess(uint32_t pid, std::vector & known_versions); ~WineProcess(); bool attach(); bool detach(); @@ -343,11 +343,11 @@ namespace DFHack void read( uint32_t address, uint32_t length, uint8_t* buffer); void write(uint32_t address, uint32_t length, uint8_t* buffer); - const string readSTLString (uint32_t offset); + const std::string readSTLString (uint32_t offset); size_t readSTLString (uint32_t offset, char * buffer, size_t bufcapacity); void writeSTLString(const uint32_t address, const std::string writeString){}; // get class name of an object with rtti/type info - string readClassName(uint32_t vptr); + std::string readClassName(uint32_t vptr); const std::string readCString (uint32_t offset); @@ -355,8 +355,8 @@ namespace DFHack bool isAttached(); bool isIdentified(); - bool getThreadIDs(vector & threads ); - void getMemRanges( vector & ranges ); + bool getThreadIDs(std::vector & threads ); + void getMemRanges(std::vector & ranges ); memory_info *getDescriptor(); int getPID(); // get module index by name and version. bool 1 = error diff --git a/library/include/dfhack/modules/Buildings.h b/library/include/dfhack/modules/Buildings.h index a9dc04494..4f8332ac6 100644 --- a/library/include/dfhack/modules/Buildings.h +++ b/library/include/dfhack/modules/Buildings.h @@ -37,7 +37,7 @@ namespace DFHack bool Finish(); // read a vector of names - bool ReadCustomWorkshopTypes(map & btypes); + bool ReadCustomWorkshopTypes(std::map & btypes); // returns -1 on error, >= 0 for real value int32_t GetCustomWorkshopType(t_building & building); diff --git a/library/include/dfhack/modules/Materials.h b/library/include/dfhack/modules/Materials.h index af2e16941..4cec9cecc 100644 --- a/library/include/dfhack/modules/Materials.h +++ b/library/include/dfhack/modules/Materials.h @@ -84,81 +84,70 @@ namespace DFHack struct t_matglossOther { - char rawname[128]; + char rawname[128]; }; struct t_creatureextract { - char rawname[128]; + char rawname[128]; }; // this doesn't transfer well across the shm gap... struct t_creaturetype { char rawname[128]; - std::vector castes; - std::vector extract; - uint8_t tile_character; - struct - { - uint16_t fore; - uint16_t back; - uint16_t bright; - } tilecolor; + std::vector castes; + std::vector extract; + uint8_t tile_character; + struct + { + uint16_t fore; + uint16_t back; + uint16_t bright; + } tilecolor; }; // this structure describes what are things made of in the DF world struct t_material { - int16_t itemType; - int16_t subType; - int16_t subIndex; - int32_t index; - uint32_t flags; + int16_t itemType; + int16_t subType; + int16_t subIndex; + int32_t index; + uint32_t flags; }; class DFHACK_EXPORT Materials { - public: - Materials(DFHack::DFContextShared * _d); - ~Materials(); + public: + Materials(DFHack::DFContextShared * _d); + ~Materials(); - std::vector inorganic; - std::vector organic; - std::vector tree; - std::vector plant; - std::vector race; - std::vector raceEx; - std::vector color; - std::vector other; - std::vector alldesc; + std::vector inorganic; + std::vector organic; + std::vector tree; + std::vector plant; + std::vector race; + std::vector raceEx; + std::vector color; + std::vector other; + std::vector alldesc; - bool ReadInorganicMaterials (void); - bool ReadOrganicMaterials (void); - bool ReadWoodMaterials (void); - bool ReadPlantMaterials (void); - bool ReadCreatureTypes (void); - bool ReadCreatureTypesEx (void); - bool ReadDescriptorColors(void); - bool ReadOthers (void); + bool ReadInorganicMaterials (void); + bool ReadOrganicMaterials (void); + bool ReadWoodMaterials (void); + bool ReadPlantMaterials (void); + bool ReadCreatureTypes (void); + bool ReadCreatureTypesEx (void); + bool ReadDescriptorColors(void); + bool ReadOthers (void); - void ReadAllMaterials(void); + void ReadAllMaterials(void); - std::string getDescription(t_material & mat); - /* - bool ReadInorganicMaterials (std::vector & output); - bool ReadOrganicMaterials (std::vector & output); - bool ReadWoodMaterials (std::vector & output); - bool ReadPlantMaterials (std::vector & output); - - // TODO: maybe move to creatures? - bool ReadCreatureTypes (std::vector & output); - bool ReadCreatureTypesEx (vector & creatures); - bool ReadDescriptorColors(std::vector & output); - */ - private: - class Private; - Private* d; - }; + std::string getDescription(t_material & mat); + private: + class Private; + Private* d; + }; } #endif diff --git a/library/modules/Buildings_C.cpp b/library/modules/Buildings_C.cpp index 7eaaa48a6..d7b7d940e 100644 --- a/library/modules/Buildings_C.cpp +++ b/library/modules/Buildings_C.cpp @@ -23,7 +23,7 @@ distribution. */ #include "dfhack-c/modules/Buildings_C.h" - +using namespace std; #ifdef __cplusplus extern "C" { #endif @@ -70,33 +70,27 @@ int Buildings_GetCustomWorkshopType(DFHackObject* b_Ptr, t_building* building) int Buildings_ReadCustomWorkshopTypes(DFHackObject* b_Ptr, void* (*t_customWorkshop_buffer_create)(uint32_t)) { - if(b_Ptr != NULL) - { - int i; - t_customWorkshop* cw_Ptr; - map bTypes; - map::iterator bIter; - - bool result = ((DFHack::Buildings*)b_Ptr)->ReadCustomWorkshopTypes(bTypes); - - if(!result) - return 0; - - cw_Ptr = (t_customWorkshop*)((*t_customWorkshop_buffer_create)(bTypes.size())); - - for(i = 0, bIter = bTypes.begin(); bIter != bTypes.end(); bIter++, i++) - { - cw_Ptr[i].index = (*bIter).first; - - size_t length = (*bIter).second.copy(cw_Ptr[i].name, 256); - - cw_Ptr[i].name[length] = '\0'; - } - - return 1; - } - - return -1; + if(b_Ptr != NULL) + { + int i; + t_customWorkshop* cw_Ptr; + std::map bTypes; + map::iterator bIter; + + if(!((DFHack::Buildings*)b_Ptr)->ReadCustomWorkshopTypes(bTypes)) + return 0; + + cw_Ptr = (t_customWorkshop*)((*t_customWorkshop_buffer_create)(bTypes.size())); + for(i = 0, bIter = bTypes.begin(); bIter != bTypes.end(); bIter++, i++) + { + cw_Ptr[i].index = (*bIter).first; + size_t length = (*bIter).second.copy(cw_Ptr[i].name, 256); + cw_Ptr[i].name[length] = '\0'; + } + return 1; + } + + return -1; } #ifdef __cplusplus diff --git a/tools/examples/buildingsdump.cpp b/tools/examples/buildingsdump.cpp index 1f0be6fc7..bfb747685 100644 --- a/tools/examples/buildingsdump.cpp +++ b/tools/examples/buildingsdump.cpp @@ -5,8 +5,10 @@ #include #include #include -using namespace std; +#include +//using namespace std; +#define DFHACK_WANT_MISCUTILS #include int main (int argc,const char* argv[]) @@ -27,14 +29,14 @@ int main (int argc,const char* argv[]) } else if(argc == 3) { - string s = argv[2]; //blah. I don't care - istringstream ins; // Declare an input string stream. + std::string s = argv[2]; //blah. I don't care + std::istringstream ins; // Declare an input string stream. ins.str(s); // Specify string to read. ins >> lines; // Reads the integers from the string. mode = 1; } - map custom_workshop_types; + std::map custom_workshop_types; DFHack::ContextManager DFMgr ("Memory.xml"); DFHack::Context *DF; @@ -43,9 +45,9 @@ int main (int argc,const char* argv[]) DF = DFMgr.getSingleContext(); DF->Attach(); } - catch (exception& e) + catch (std::exception& e) { - cerr << e.what() << endl; + std::cerr << e.what() << std::endl; #ifndef LINUX_BUILD cin.ignore(); #endif @@ -62,17 +64,17 @@ int main (int argc,const char* argv[]) Bld->ReadCustomWorkshopTypes(custom_workshop_types); if(mode) { - cout << numBuildings << endl; - vector < uint32_t > addresses; + std::cout << numBuildings << std::endl; + std::vector < uint32_t > addresses; for(uint32_t i = 0; i < numBuildings; i++) { DFHack::t_building temp; Bld->Read(i, temp); if(temp.type != 0xFFFFFFFF) // check if type isn't invalid { - string typestr; + std::string typestr; mem->resolveClassIDToClassname(temp.type, typestr); - cout << typestr << endl; + std::cout << typestr << std::endl; if(typestr == argv[1]) { //cout << buildingtypes[temp.type] << " 0x" << hex << temp.origin << endl; @@ -83,7 +85,7 @@ int main (int argc,const char* argv[]) else { // couldn't translate type, print out the vtable - cout << "unknown vtable: " << temp.vtable << endl; + std::cout << "unknown vtable: " << temp.vtable << std::endl; } } interleave_hex(DF,addresses,lines / 4); @@ -105,7 +107,7 @@ int main (int argc,const char* argv[]) && (uint32_t)z == temp.z ) { - string typestr; + std::string typestr; mem->resolveClassIDToClassname(temp.type, typestr); printf("Address 0x%x, type %d (%s), %d/%d/%d\n",temp.origin, temp.type, typestr.c_str(), temp.x1,temp.y1,temp.z); printf("Material %d %d\n", temp.material.type, temp.material.index); @@ -120,12 +122,12 @@ int main (int argc,const char* argv[]) } else { - cout << numBuildings << endl; + std::cout << numBuildings << std::endl; for(uint32_t i = 0; i < numBuildings; i++) { DFHack::t_building temp; Bld->Read(i, temp); - string typestr; + std::string typestr; mem->resolveClassIDToClassname(temp.type, typestr); printf("Address 0x%x, type %d (%s), %d/%d/%d\n",temp.origin, temp.type, typestr.c_str(), temp.x1,temp.y1,temp.z); } @@ -135,12 +137,12 @@ int main (int argc,const char* argv[]) } else { - cerr << "buildings not supported for this DF version" << endl; + std::cerr << "buildings not supported for this DF version" << std::endl; } DF->Detach(); #ifndef LINUX_BUILD - cout << "Done. Press any key to continue" << endl; + std::cout << "Done. Press any key to continue" << std::endl; cin.ignore(); #endif return 0; diff --git a/tools/examples/construction_dump.cpp b/tools/examples/construction_dump.cpp index a48b4e6a9..26bbef35d 100644 --- a/tools/examples/construction_dump.cpp +++ b/tools/examples/construction_dump.cpp @@ -7,8 +7,9 @@ #include #include #include -using namespace std; +#include +#define DFHACK_WANT_MISCUTILS #include using namespace DFHack; @@ -21,9 +22,9 @@ int main (int numargs, const char ** args) DF = DFMgr.getSingleContext(); DF->Attach(); } - catch (exception& e) + catch (std::exception& e) { - cerr << e.what() << endl; + std::cerr << e.what() << std::endl; #ifndef LINUX_BUILD cin.ignore(); #endif @@ -51,7 +52,7 @@ int main (int numargs, const char ** args) printf("Construction %d/%d/%d @ 0x%x\n", con.x, con.y, con.z,con.origin); // inorganic stuff - we can recognize that printf("Material: form %d, type %d, index %d\n",con.form, con.mat_type, con.mat_idx); - string matstr = "unknown"; + std::string matstr = "unknown"; if(con.mat_type == 0) { if(con.mat_idx != 0xffffffff) diff --git a/tools/examples/creaturedump.cpp b/tools/examples/creaturedump.cpp index f8b63b51f..8c2667c20 100644 --- a/tools/examples/creaturedump.cpp +++ b/tools/examples/creaturedump.cpp @@ -4,8 +4,10 @@ #include #include #include +#include using namespace std; +#define DFHACK_WANT_MISCUTILS #include enum likeType diff --git a/tools/examples/dfitemdump.cpp b/tools/examples/dfitemdump.cpp index 0ed6413b2..cf1778326 100644 --- a/tools/examples/dfitemdump.cpp +++ b/tools/examples/dfitemdump.cpp @@ -11,6 +11,7 @@ using namespace std; #include +#include DFHack::Materials * Materials; diff --git a/tools/examples/spatterdump.cpp b/tools/examples/spatterdump.cpp index 3d3b92102..3a2ba82b2 100644 --- a/tools/examples/spatterdump.cpp +++ b/tools/examples/spatterdump.cpp @@ -8,7 +8,7 @@ #include #include using namespace std; - +#define DFHACK_WANT_MISCUTILS #include using namespace DFHack; diff --git a/tools/examples/treedump.cpp b/tools/examples/treedump.cpp index 7e54db674..71b386220 100644 --- a/tools/examples/treedump.cpp +++ b/tools/examples/treedump.cpp @@ -9,6 +9,7 @@ #include using namespace std; +#define DFHACK_WANT_MISCUTILS #include int main (int numargs, const char ** args) @@ -34,18 +35,17 @@ int main (int numargs, const char ** args) #endif return 1; } - + DFHack::Process* p = DF->getProcess(); DFHack::memory_info* mem = DF->getMemoryInfo(); DFHack::Position * pos = DF->getPosition(); DFHack::Vegetation * v = DF->getVegetation(); DFHack::Materials * mat = DF->getMaterials(); mat->ReadOrganicMaterials(); - + int32_t x,y,z; pos->getCursorCoords(x,y,z); - - + uint32_t numVegs = 0; v->Start(numVegs); if(x == -30000) @@ -89,7 +89,7 @@ int main (int numargs, const char ** args) } } v->Finish(); - + #ifndef LINUX_BUILD cout << "Done. Press any key to continue" << endl; cin.ignore(); diff --git a/tools/examples/veinlook.cpp b/tools/examples/veinlook.cpp index 63ad703bf..e0fc79004 100644 --- a/tools/examples/veinlook.cpp +++ b/tools/examples/veinlook.cpp @@ -15,8 +15,9 @@ using namespace std; #include #include +#define DFHACK_WANT_MISCUTILS +#define DFHACK_WANT_TILETYPES #include -#include using namespace DFHack; diff --git a/tools/supported/probe.cpp b/tools/supported/probe.cpp index 4353d48ba..832562dc5 100644 --- a/tools/supported/probe.cpp +++ b/tools/supported/probe.cpp @@ -7,10 +7,10 @@ #include #include #include -using namespace std; +#define DFHACK_WANT_MISCUTILS +#define DFHACK_WANT_TILETYPES #include -#include using namespace DFHack; int main (int numargs, const char ** args) @@ -22,9 +22,9 @@ int main (int numargs, const char ** args) { DF->Attach(); } - catch (exception& e) + catch (std::exception& e) { - cerr << e.what() << endl; + std::cerr << e.what() << std::endl; #ifndef LINUX_BUILD cin.ignore(); #endif @@ -68,59 +68,59 @@ int main (int numargs, const char ** args) int16_t tiletype = block.tiletypes[tileX][tileY]; naked_designation &des = block.designation[tileX][tileY].bits; uint32_t &desw = block.designation[tileX][tileY].whole; - print_bits(block.designation[tileX][tileY].whole,cout); - cout << endl; - print_bits(block.occupancy[tileX][tileY].whole,cout); - cout << endl; + print_bits(block.designation[tileX][tileY].whole,std::cout); + std::cout << endl; + print_bits(block.occupancy[tileX][tileY].whole,std::cout); + std::cout << endl; // tiletype - cout <<"tiletype: " << tiletype; + std::cout <<"tiletype: " << tiletype; if(tileTypeTable[tiletype].name) - cout << " = " << tileTypeTable[tiletype].name; - cout << endl; + std::cout << " = " << tileTypeTable[tiletype].name; + std::cout << std::endl; - cout <<"temperature1: " << tmpb1[tileX][tileY] << " U" << endl; - cout <<"temperature2: " << tmpb2[tileX][tileY] << " U" << endl; + std::cout <<"temperature1: " << tmpb1[tileX][tileY] << " U" << std::endl; + std::cout <<"temperature2: " << tmpb2[tileX][tileY] << " U" << std::endl; // biome, geolayer - cout << "biome: " << des.biome << endl; - cout << "geolayer: " << des.geolayer_index << endl; + std::cout << "biome: " << des.biome << std::endl; + std::cout << "geolayer: " << des.geolayer_index << std::endl; // liquids if(des.flow_size) { if(des.liquid_type == DFHack::liquid_magma) - cout <<"magma: "; - else cout <<"water: "; - cout << des.flow_size << endl; + std::cout <<"magma: "; + else std::cout <<"water: "; + std::cout << des.flow_size << std::endl; } if(des.flow_forbid) - cout << "flow forbid" << endl; + std::cout << "flow forbid" << std::endl; if(des.pile) - cout << "stockpile?" << endl; + std::cout << "stockpile?" << std::endl; if(des.rained) - cout << "rained?" << endl; + std::cout << "rained?" << std::endl; if(des.smooth) - cout << "smooth?" << endl; + std::cout << "smooth?" << std::endl; uint32_t designato = block.origin + designatus + (tileX * 16 + tileY) * sizeof(t_designation); printf("designation offset: 0x%x\n", designato); if(des.light) - cout << "Light "; + std::cout << "Light "; else - cout << " "; + std::cout << " "; if(des.skyview) - cout << "SkyView "; + std::cout << "SkyView "; else - cout << " "; + std::cout << " "; if(des.subterranean) - cout << "Underground "; + std::cout << "Underground "; else - cout << " "; - cout << endl; + std::cout << " "; + std::cout << std::endl; } } #ifndef LINUX_BUILD - cout << "Done. Press any key to continue" << endl; + std::cout << "Done. Press any key to continue" << std::endl; cin.ignore(); #endif return 0;