// This is a reveal program. It reveals the map. #include #include #include using namespace std; #include #include #include int main (void) { uint32_t x_max,y_max,z_max; DFHack::designations40d designations; DFHack::API DF("Memory.xml"); try { DF.Attach(); } catch (exception& e) { cerr << e.what() << endl; #ifndef LINUX_BUILD cin.ignore(); #endif return 1; } DFHack::Maps *Maps =DF.getMaps(); // init the map if(!Maps->Start()) { cerr << "Can't init map." << endl; #ifndef LINUX_BUILD cin.ignore(); #endif return 1; } Maps->getSize(x_max,y_max,z_max); // walk the map for(uint32_t x = 0; x< x_max;x++) { for(uint32_t y = 0; y< y_max;y++) { for(uint32_t z = 0; z< z_max;z++) { if(Maps->isValidBlock(x,y,z)) { // read block designations Maps->ReadDesignations(x,y,z, &designations); // change the hidden flag to 0 for (uint32_t i = 0; i < 16;i++) for (uint32_t j = 0; j < 16;j++) { designations[i][j].bits.hidden = 0; } // write the designations back Maps->WriteDesignations(x,y,z, &designations); } } } } DF.Detach(); #ifndef LINUX_BUILD cout << "Done. Press any key to continue" << endl; cin.ignore(); #endif return 0; }