diff --git a/CMakeLists.txt b/CMakeLists.txt index fa85ba2a0..879b01f95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,10 +35,6 @@ include_directories (${CMAKE_SOURCE_DIR}/dfhack/depends/argstream/) add_subdirectory (dfhack) #add_subdirectory (dfhack/python) add_subdirectory (dfhack/shm) -#FIXME: add exports for MSVC -#add_subdirectory (dfhack/depends/md5) -#add_subdirectory (dfhack/depends/tinyxml) -#add_subdirectory (dfhack/depends/argstream) -add_subdirectory (tools) -add_subdirectory (examples) -add_subdirectory (playground) +add_subdirectory (tools/examples) +add_subdirectory (tools/playground) +add_subdirectory (tools/supported) diff --git a/dfhack/modules/Position.cpp b/dfhack/modules/Position.cpp index 5fb252585..3690d36e9 100644 --- a/dfhack/modules/Position.cpp +++ b/dfhack/modules/Position.cpp @@ -29,9 +29,6 @@ distribution. #include "DFProcess.h" using namespace DFHack; - - - struct Position::Private { uint32_t window_x_offset; @@ -39,19 +36,17 @@ struct Position::Private uint32_t window_z_offset; uint32_t cursor_xyz_offset; uint32_t window_dims_offset; - + uint32_t hotkey_start; uint32_t hotkey_mode_offset; uint32_t hotkey_xyz_offset; uint32_t hotkey_size; - + DFContextPrivate *d; Process * owner; bool Inited; bool Started; bool StartedHotkeys; - //uint32_t biome_stuffs; - //vector v_geology[eBiomeCount]; }; Position::Position(DFContextPrivate * d_) @@ -71,7 +66,7 @@ Position::Position(DFContextPrivate * d_) d->cursor_xyz_offset = mem->getAddress ("cursor_xyz"); d->window_dims_offset = mem->getAddress ("window_dims"); d->Started = true; - + d->hotkey_start = mem->getAddress("hotkey_start"); d->hotkey_mode_offset = mem->getOffset ("hotkey_mode"); d->hotkey_xyz_offset = mem->getOffset("hotkey_xyz"); @@ -88,10 +83,13 @@ Position::~Position() bool Position::ReadHotkeys(t_hotkey hotkeys[]) { - if (!d->StartedHotkeys) return false; + if (!d->StartedHotkeys) + { + return false; + } uint32_t currHotkey = d->hotkey_start; Process * p = d->owner; - + for(uint32_t i = 0 ; i < NUM_HOTKEYS ;i++) { p->readSTLString(currHotkey,hotkeys[i].name,10); @@ -106,7 +104,7 @@ bool Position::getViewCoords (int32_t &x, int32_t &y, int32_t &z) { if (!d->Inited) return false; Process * p = d->owner; - + p->readDWord (d->window_x_offset, (uint32_t &) x); p->readDWord (d->window_y_offset, (uint32_t &) y); p->readDWord (d->window_z_offset, (uint32_t &) z); @@ -116,9 +114,12 @@ bool Position::getViewCoords (int32_t &x, int32_t &y, int32_t &z) //FIXME: confine writing of coords to map bounds? bool Position::setViewCoords (const int32_t x, const int32_t y, const int32_t z) { - if (!d->Inited) return false; + if (!d->Inited) + { + return false; + } Process * p = d->owner; - + p->writeDWord (d->window_x_offset, (uint32_t) x); p->writeDWord (d->window_y_offset, (uint32_t) y); p->writeDWord (d->window_z_offset, (uint32_t) z); @@ -149,7 +150,7 @@ bool Position::setCursorCoords (const int32_t x, const int32_t y, const int32_t bool Position::getWindowSize (int32_t &width, int32_t &height) { if(!d->Inited) return false; - + int32_t coords[2]; d->owner->read (d->window_dims_offset, 2*sizeof (int32_t), (uint8_t *) coords); width = coords[0]; diff --git a/examples/veccheck.cpp b/examples/veccheck.cpp deleted file mode 100644 index 02465bbc4..000000000 --- a/examples/veccheck.cpp +++ /dev/null @@ -1,208 +0,0 @@ -// Just show some position data - -#include -#include -#include -#include -#include -#include -#include -#include -using namespace std; - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace DFHack; -/* -int __userpurge get_feature_at(__int16 tZ, __int16 tY, int world_base, signed __int16 tX) -{ - int block; // ebp@1 - signed __int16 __tX; // di@1 - signed int _tY; // esi@1 - int designation; // eax@2 - int _tX; // ecx@2 - signed int v9; // eax@4 - int v10; // edx@4 - __int64 region_x_local; // qax@4 - __int16 v12; // cx@4 - __int16 v13; // ax@5 - int v14; // esi@5 - int result; // eax@7 - unsigned int some_stuff; // ebp@10 - int v17; // edx@11 - int _designation; // [sp+10h] [bp+4h]@2 - - __tX = tX; - LOWORD(_tY) = tY; - block = getBlock(world_base, tX, tY, tZ); - if ( !block ) - goto LABEL_17; - _tX = tX; - _tY = (signed __int16)_tY; - designation = *(_DWORD *)(block + 0x29C + 4 * ((signed __int16)_tY % 16 + 16 * tX % 16)); - _designation = designation; - if ( designation & 0x10000000 && *(_WORD *)(block + 0x2C) != -1 )// first feature_present bit - adamantine - { - region_x_local = __tX / 48 + *(_DWORD *)(world_base + 0x525C8);// tile_x / 48 + region_x - v12 = ((BYTE4(region_x_local) & 0xF) + (_DWORD)region_x_local) >> 4; - WORD2(region_x_local) = (_tY / 48 + *(_DWORD *)(world_base + 0x525CC)) / 16;// tile_y / 48 + region_y - v9 = v12; - _tX = SWORD2(region_x_local); - v10 = *(_DWORD *)(*(_DWORD *)(*(_DWORD *)(world_base + 0x54440) + 4 * (v9 >> 4)) - + 16 * (SWORD2(region_x_local) >> 4) - + 4); - if ( v10 ) - { - _tX %= 16; - v14 = v10 + 24 * ((signed __int16)_tX + 16 * v9 % 16); - v13 = *(_WORD *)(block + 0x2C); - if ( v13 >= 0 ) - { - _tX = (*(_DWORD *)(v14 + 16) - *(_DWORD *)(v14 + 12)) >> 2; - if ( v13 < (unsigned int)_tX ) - return *(_DWORD *)sub_519100(_tX, v10); - } - } - designation = _designation; - } - if ( designation & 0x20000000 && (some_stuff = *(_DWORD *)(block + 0x30), some_stuff != -1) )// second feature_present bit - slade and hell - { - v17 = (*(_DWORD *)(world_base + 0x54384) - *(_DWORD *)(world_base + 0x54380)) >> 2; - if ( some_stuff >= v17 ) - _invalid_parameter_noinfo(_tX, v17); - result = *(_DWORD *)(*(_DWORD *)(*(_DWORD *)(world_base + 0x54380) + 4 * some_stuff) + 0x100); - } - else - { -LABEL_17: - result = 0; - } - return result; -} -*/ -int main (int numargs, const char ** args) -{ - - DFHack::ContextManager DFMgr("Memory.xml"); - DFHack::Context * DF; - try - { - DF = DFMgr.getSingleContext(); - DF->Attach(); - } - catch (exception& e) - { - cerr << e.what() << endl; - #ifndef LINUX_BUILD - cin.ignore(); - #endif - return 1; - } - - DFHack::Position *Pos = DF->getPosition(); - DFHack::memory_info* mem = DF->getMemoryInfo(); - DFHack::Maps *Maps = DF->getMaps(); - DFHack::Process * p = DF->getProcess(); - uint32_t designatus = mem->getOffset("map_data_designation"); - uint32_t block_feature1 = mem->getOffset("map_data_feature_local"); - uint32_t block_feature2 = mem->getOffset("map_data_feature_global"); - uint32_t region_x_offset = mem->getAddress("region_x"); - uint32_t region_y_offset = mem->getAddress("region_y"); - uint32_t region_z_offset = mem->getAddress("region_z"); - uint32_t feature1_start_ptr = mem->getAddress("local_feature_start_ptr"); - int32_t regionX, regionY, regionZ; - - // read position of the region inside DF world - p->readDWord (region_x_offset, (uint32_t &)regionX); - p->readDWord (region_y_offset, (uint32_t &)regionY); - p->readDWord (region_z_offset, (uint32_t &)regionZ); - - Maps->Start(); - - int32_t cursorX, cursorY, cursorZ; - Pos->getCursorCoords(cursorX,cursorY,cursorZ); - if(cursorX != -30000) - { - uint32_t blockX = cursorX / 16; - uint32_t tileX = cursorX % 16; - uint32_t blockY = cursorY / 16; - uint32_t tileY = cursorY % 16; - t_temperatures tmpb1, tmpb2; - mapblock40d block; - if(Maps->ReadBlock40d(blockX,blockY,cursorZ,&block)) - { - Maps->ReadTemperatures(blockX,blockY,cursorZ,&tmpb1, &tmpb2); - printf("block addr: 0x%x\n", block.origin); - 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; - - // tiletype - cout <<"tiletype: " << tiletype; - if(tileTypeTable[tiletype].name) - cout << " = " << tileTypeTable[tiletype].name; - cout << endl; - - - cout <<"temperature1: " << tmpb1[tileX][tileY] << " U" << endl; - cout <<"temperature2: " << tmpb2[tileX][tileY] << " U" << endl; - - // biome, geolayer - cout << "biome: " << des.biome << endl; - cout << "geolayer: " << des.geolayer_index << endl; - // liquids - if(des.flow_size) - { - if(des.liquid_type == DFHack::liquid_magma) - cout <<"magma: "; - else cout <<"water: "; - cout << des.flow_size << endl; - } - if(des.flow_forbid) - cout << "flow forbid" << endl; - if(des.pile) - cout << "stockpile?" << endl; - if(des.rained) - cout << "rained?" << endl; - if(des.smooth) - cout << "smooth?" << endl; - uint32_t designato = block.origin + designatus + (tileX * 16 + tileY) * sizeof(t_designation); - printf("designation offset: 0x%x\n", designato); - if(des.light) - cout << "L"; - else - cout << " "; - if(des.skyview) - cout << "S"; - else - cout << " "; - if(des.subterranean) - cout << "U"; - else - cout << " "; - cout << endl; - } - } - #ifndef LINUX_BUILD - cout << "Done. Press any key to continue" << endl; - cin.ignore(); - #endif - return 0; -} diff --git a/playground/CMakeLists.txt b/playground/CMakeLists.txt deleted file mode 100644 index 4c689a6b0..000000000 --- a/playground/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# don't use this file directly. use the one in the root folder of the project - -# this is required to ensure we use the right configuration for the system. -IF(UNIX) -add_definitions(-DLINUX_BUILD) -ENDIF(UNIX) - -# for trying out some 'stuff' -ADD_EXECUTABLE(dftest test.cpp) -TARGET_LINK_LIBRARIES(dftest dfhack) - diff --git a/examples/CMakeLists.txt b/tools/examples/CMakeLists.txt similarity index 68% rename from examples/CMakeLists.txt rename to tools/examples/CMakeLists.txt index 1276e4b38..3662181b4 100644 --- a/examples/CMakeLists.txt +++ b/tools/examples/CMakeLists.txt @@ -5,10 +5,6 @@ IF(UNIX) add_definitions(-DLINUX_BUILD) ENDIF(UNIX) -# attachtest - 100x attach/detach, suspend/resume -ADD_EXECUTABLE(dfattachtest attachtest.cpp) -TARGET_LINK_LIBRARIES(dfattachtest dfhack) - # buildingsdump - dump buildings and their raw data filtered by type ADD_EXECUTABLE(dfbuildingsdump buildingsdump.cpp) TARGET_LINK_LIBRARIES(dfbuildingsdump dfhack) @@ -17,10 +13,6 @@ TARGET_LINK_LIBRARIES(dfbuildingsdump dfhack) ADD_EXECUTABLE(dfconstructiondump construction_dump.cpp) TARGET_LINK_LIBRARIES(dfconstructiondump dfhack) -# a benchmark program, reads the map 1000x -ADD_EXECUTABLE(dfexpbench expbench.cpp) -TARGET_LINK_LIBRARIES(dfexpbench dfhack) - # creaturedump - basic creature dump - a test of the creature related exports ADD_EXECUTABLE(dfcreaturedump creaturedump.cpp) TARGET_LINK_LIBRARIES(dfcreaturedump dfhack) @@ -33,11 +25,6 @@ TARGET_LINK_LIBRARIES(dfmaterialtest dfhack) ADD_EXECUTABLE(dfposition position.cpp) TARGET_LINK_LIBRARIES(dfposition dfhack) -# suspendtest - test if suspend works. df should stop responding when suspended -# by dfhack -ADD_EXECUTABLE(dfsuspend suspendtest.cpp) -TARGET_LINK_LIBRARIES(dfsuspend dfhack) - # itemdump - dump the item under the cursor ADD_EXECUTABLE(dfitemdump dfitemdump.cpp) TARGET_LINK_LIBRARIES(dfitemdump dfhack) @@ -47,20 +34,11 @@ TARGET_LINK_LIBRARIES(dfitemdump dfhack) ADD_EXECUTABLE(dfhotkeynotedump hotkeynotedump.cpp) TARGET_LINK_LIBRARIES(dfhotkeynotedump dfhack) -# findnameindexes -# Author: belal -#ADD_EXECUTABLE(dffindnameindexes findnameindexes.cpp) -#TARGET_LINK_LIBRARIES(dffindnameindexes dfhack) - # settlementdump - dumps the settlements on the loaded map # Author: belal # ADD_EXECUTABLE(dfsettlementdump settlementdump.cpp) # TARGET_LINK_LIBRARIES(dfsettlementdump dfhack) -# veccheck - read vector values at address -ADD_EXECUTABLE(dfvecc veccheck.cpp) -TARGET_LINK_LIBRARIES(dfvecc dfhack) - # treedump - dump them trees! ADD_EXECUTABLE(dftreedump treedump.cpp) TARGET_LINK_LIBRARIES(dftreedump dfhack) @@ -69,15 +47,6 @@ TARGET_LINK_LIBRARIES(dftreedump dfhack) ADD_EXECUTABLE(dfspatterdump spatterdump.cpp) TARGET_LINK_LIBRARIES(dfspatterdump dfhack) -# catsplosion - Accelerates pregnancy -# Author: Zhentar -ADD_EXECUTABLE(dfcatsplosion catsplosion.cpp) -TARGET_LINK_LIBRARIES(dfcatsplosion dfhack) - -# flows - check flows impact on fps -ADD_EXECUTABLE(dfflows flows.cpp) -TARGET_LINK_LIBRARIES(dfflows dfhack) - IF(UNIX) SET(CURSES_NEED_WIDE "YES") SET(CURSES_NEED_NCURSES "NO") @@ -112,30 +81,4 @@ IF(UNIX) ELSE(CURSES_FOUND) MESSAGE(STATUS "Wide-character ncurses library not found - veinlook can't be built") ENDIF(CURSES_FOUND) -ENDIF(UNIX) - -# renamer - change the custom names and professions of creatures, sends keys to -# df directly -# Author: belal -#ADD_EXECUTABLE(dfrenamer renamer.cpp) -#TARGET_LINK_LIBRARIES(dfrenamer dfhack) - -IF(UNIX) -install(TARGETS -dfattachtest -#dfexpbench -#dfcreaturedump -#dfbuildingsdump -dfmaterialtest -dfposition -dfsuspend -#dfitemdump -#dfhotkeynotedump -#dffindnameindexes -#dfsettlementdump -#dfrenamer -dfvecc -#dfcatsplosion -RUNTIME DESTINATION bin -) -ENDIF(UNIX) +ENDIF(UNIX) \ No newline at end of file diff --git a/examples/buildingsdump.cpp b/tools/examples/buildingsdump.cpp similarity index 100% rename from examples/buildingsdump.cpp rename to tools/examples/buildingsdump.cpp diff --git a/examples/construction_dump.cpp b/tools/examples/construction_dump.cpp similarity index 100% rename from examples/construction_dump.cpp rename to tools/examples/construction_dump.cpp diff --git a/examples/creaturedump.cpp b/tools/examples/creaturedump.cpp similarity index 100% rename from examples/creaturedump.cpp rename to tools/examples/creaturedump.cpp diff --git a/examples/dfitemdump.cpp b/tools/examples/dfitemdump.cpp similarity index 100% rename from examples/dfitemdump.cpp rename to tools/examples/dfitemdump.cpp diff --git a/examples/fake-curses.h.cmake b/tools/examples/fake-curses.h.cmake similarity index 100% rename from examples/fake-curses.h.cmake rename to tools/examples/fake-curses.h.cmake diff --git a/examples/hotkeynotedump.cpp b/tools/examples/hotkeynotedump.cpp similarity index 100% rename from examples/hotkeynotedump.cpp rename to tools/examples/hotkeynotedump.cpp diff --git a/examples/materialtest.cpp b/tools/examples/materialtest.cpp similarity index 100% rename from examples/materialtest.cpp rename to tools/examples/materialtest.cpp diff --git a/examples/position.cpp b/tools/examples/position.cpp similarity index 100% rename from examples/position.cpp rename to tools/examples/position.cpp diff --git a/examples/settlementdump.cpp b/tools/examples/settlementdump.cpp similarity index 100% rename from examples/settlementdump.cpp rename to tools/examples/settlementdump.cpp diff --git a/examples/spatterdump.cpp b/tools/examples/spatterdump.cpp similarity index 100% rename from examples/spatterdump.cpp rename to tools/examples/spatterdump.cpp diff --git a/examples/treedump.cpp b/tools/examples/treedump.cpp similarity index 100% rename from examples/treedump.cpp rename to tools/examples/treedump.cpp diff --git a/examples/veinlook.cpp b/tools/examples/veinlook.cpp similarity index 100% rename from examples/veinlook.cpp rename to tools/examples/veinlook.cpp diff --git a/tools/playground/CMakeLists.txt b/tools/playground/CMakeLists.txt new file mode 100644 index 000000000..ee43d8c20 --- /dev/null +++ b/tools/playground/CMakeLists.txt @@ -0,0 +1,58 @@ +# don't use this file directly. use the one in the root folder of the project + +# this is required to ensure we use the right configuration for the system. +IF(UNIX) +add_definitions(-DLINUX_BUILD) +ENDIF(UNIX) + +# a creature mood dump hack. has hardcoded offsets +ADD_EXECUTABLE(dfmoodump moodump.cpp) +TARGET_LINK_LIBRARIES(dfmoodump dfhack) + +# for trying out some 'stuff' +ADD_EXECUTABLE(dftest test.cpp) +TARGET_LINK_LIBRARIES(dftest dfhack) + +# bauxite - turn all mechanisms into bauxite mechanisms +# Author: Alex Legg +#ADD_EXECUTABLE(dfbauxite dfbauxite.cpp) +#TARGET_LINK_LIBRARIES(dfbauxite dfhack) + +# digger - designate for digging by tile class +# Author: mizipzor +ADD_EXECUTABLE(dfdigger digger.cpp) +TARGET_LINK_LIBRARIES(dfdigger dfhack) + +# digger2 - designate for digging from a text file +# Author: rOut +ADD_EXECUTABLE(dfdigger2 digger2.cpp) +TARGET_LINK_LIBRARIES(dfdigger2 dfhack) + +# itemdesignator - change some item designations (dump, forbid, on-fire) for all +# items of a given type and material +# Author: belal +#ADD_EXECUTABLE(dfitemdesignator itemdesignator.cpp) +#TARGET_LINK_LIBRARIES(dfitemdesignator dfhack) + +# incrementalsearch - a bit like cheat engine, only DF-specific, very basic +# and Linux-only +IF(UNIX) + ADD_EXECUTABLE(dfincremental incrementalsearch.cpp) + TARGET_LINK_LIBRARIES(dfincremental dfhack) +ENDIF(UNIX) + +# catsplosion - Accelerates pregnancy +# Author: Zhentar +ADD_EXECUTABLE(dfcatsplosion catsplosion.cpp) +TARGET_LINK_LIBRARIES(dfcatsplosion dfhack) + +# findnameindexes +# Author: belal +#ADD_EXECUTABLE(dffindnameindexes findnameindexes.cpp) +#TARGET_LINK_LIBRARIES(dffindnameindexes dfhack) + +# renamer - change the custom names and professions of creatures, sends keys to +# df directly +# Author: belal +#ADD_EXECUTABLE(dfrenamer renamer.cpp) +#TARGET_LINK_LIBRARIES(dfrenamer dfhack) \ No newline at end of file diff --git a/examples/catsplosion.cpp b/tools/playground/catsplosion.cpp similarity index 100% rename from examples/catsplosion.cpp rename to tools/playground/catsplosion.cpp diff --git a/tools/dfbauxite.cpp b/tools/playground/dfbauxite.cpp similarity index 100% rename from tools/dfbauxite.cpp rename to tools/playground/dfbauxite.cpp diff --git a/tools/digger.cpp b/tools/playground/digger.cpp similarity index 100% rename from tools/digger.cpp rename to tools/playground/digger.cpp diff --git a/tools/digger2.cpp b/tools/playground/digger2.cpp similarity index 100% rename from tools/digger2.cpp rename to tools/playground/digger2.cpp diff --git a/examples/findnameindexes.cpp b/tools/playground/findnameindexes.cpp similarity index 95% rename from examples/findnameindexes.cpp rename to tools/playground/findnameindexes.cpp index 720cb69a3..6a52a2c24 100644 --- a/examples/findnameindexes.cpp +++ b/tools/playground/findnameindexes.cpp @@ -1,5 +1,8 @@ -// Dwarf fortress names are a complicated beast, in objects they are displayed as indexes into the language vectors -// use this tool if you are trying to find what the indexes are for a displayed name, so you can then search for it in your object +// Dwarf fortress names are a complicated beast, in objects they are displayed +// as indexes into the language vectors +// +// use this tool if you are trying to find what the indexes are for a displayed +// name, so you can then search for it in your object #include #include diff --git a/tools/incrementalsearch.cpp b/tools/playground/incrementalsearch.cpp similarity index 100% rename from tools/incrementalsearch.cpp rename to tools/playground/incrementalsearch.cpp diff --git a/tools/itemdesignator.cpp b/tools/playground/itemdesignator.cpp similarity index 100% rename from tools/itemdesignator.cpp rename to tools/playground/itemdesignator.cpp diff --git a/tools/moodump.cpp b/tools/playground/moodump.cpp similarity index 100% rename from tools/moodump.cpp rename to tools/playground/moodump.cpp diff --git a/examples/renamer.cpp b/tools/playground/renamer.cpp similarity index 100% rename from examples/renamer.cpp rename to tools/playground/renamer.cpp diff --git a/playground/test.cpp b/tools/playground/test.cpp similarity index 100% rename from playground/test.cpp rename to tools/playground/test.cpp diff --git a/tools/CMakeLists.txt b/tools/supported/CMakeLists.txt similarity index 50% rename from tools/CMakeLists.txt rename to tools/supported/CMakeLists.txt index 611a638a4..c8b278997 100644 --- a/tools/CMakeLists.txt +++ b/tools/supported/CMakeLists.txt @@ -9,10 +9,6 @@ ENDIF(UNIX) ADD_EXECUTABLE(dfreveal reveal.cpp) TARGET_LINK_LIBRARIES(dfreveal dfhack) -# a reveal clone -ADD_EXECUTABLE(dfmoodump moodump.cpp) -TARGET_LINK_LIBRARIES(dfmoodump dfhack) - # prospector - produces a list of available materials and their quantities ADD_EXECUTABLE(dfprospector prospector.cpp) TARGET_LINK_LIBRARIES(dfprospector dfhack) @@ -33,50 +29,41 @@ TARGET_LINK_LIBRARIES(dfunstuck dfhack) ADD_EXECUTABLE(dfprobe probe.cpp) TARGET_LINK_LIBRARIES(dfprobe dfhack) -IF(UNIX) -# incrementalsearch - a bit like cheat engine, only DF-specific, very basic -# and Linux-only -ADD_EXECUTABLE(dfincremental incrementalsearch.cpp) -TARGET_LINK_LIBRARIES(dfincremental dfhack) -ENDIF(UNIX) +# attachtest - 100x attach/detach, suspend/resume +ADD_EXECUTABLE(dfattachtest attachtest.cpp) +TARGET_LINK_LIBRARIES(dfattachtest dfhack) -# bauxite - turn all mechanisms into bauxite mechanisms -# Author: Alex Legg -#ADD_EXECUTABLE(dfbauxite dfbauxite.cpp) -#TARGET_LINK_LIBRARIES(dfbauxite dfhack) +# a benchmark program, reads the map 1000x +ADD_EXECUTABLE(dfexpbench expbench.cpp) +TARGET_LINK_LIBRARIES(dfexpbench dfhack) -# digger - designate for digging by tile class -# Author: mizipzor -ADD_EXECUTABLE(dfdigger digger.cpp) -TARGET_LINK_LIBRARIES(dfdigger dfhack) +# suspendtest - test if suspend works. df should stop responding when suspended +# by dfhack +ADD_EXECUTABLE(dfsuspend suspendtest.cpp) +TARGET_LINK_LIBRARIES(dfsuspend dfhack) -# digger2 - designate for digging from a text file -# Author: rOut -ADD_EXECUTABLE(dfdigger2 digger2.cpp) -TARGET_LINK_LIBRARIES(dfdigger2 dfhack) +# flows - check flows impact on fps +ADD_EXECUTABLE(dfflows flows.cpp) +TARGET_LINK_LIBRARIES(dfflows dfhack) -# itemdesignator - change some item designations (dump, forbid, on-fire) for all -# items of a given type and material -# Author: belal -#ADD_EXECUTABLE(dfitemdesignator itemdesignator.cpp) -#TARGET_LINK_LIBRARIES(dfitemdesignator dfhack) - -# a magma creation tool -# Author: Aleric +# liquids manipulation tool +# Original author: Aleric ADD_EXECUTABLE(dfliquids liquids.cpp) TARGET_LINK_LIBRARIES(dfliquids dfhack) IF(UNIX) install(TARGETS -#dfbauxite -#dfcleanmap -#dfdigger -dfincremental -#dfitemdesignator -#dfmagma_create -dfprospector dfreveal -dfmoodump +dfprospector +dfvdig +dfcleanmap +dfunstuck +dfprobe +dfattachtest +dfexpbench +dfsuspend +dfflows +dfliquids RUNTIME DESTINATION bin ) ENDIF(UNIX) diff --git a/examples/attachtest.cpp b/tools/supported/attachtest.cpp similarity index 100% rename from examples/attachtest.cpp rename to tools/supported/attachtest.cpp diff --git a/tools/cleanmap.cpp b/tools/supported/cleanmap.cpp similarity index 100% rename from tools/cleanmap.cpp rename to tools/supported/cleanmap.cpp diff --git a/examples/expbench.cpp b/tools/supported/expbench.cpp similarity index 100% rename from examples/expbench.cpp rename to tools/supported/expbench.cpp diff --git a/examples/flows.cpp b/tools/supported/flows.cpp similarity index 90% rename from examples/flows.cpp rename to tools/supported/flows.cpp index 7662863a7..f2e77cca1 100644 --- a/examples/flows.cpp +++ b/tools/supported/flows.cpp @@ -1,4 +1,4 @@ -// This is a reveal program. It reveals the map. +// This tool counts static tiles and active flows of water and magma. #include #include @@ -45,7 +45,7 @@ int main (void) Maps->getSize(x_max,y_max,z_max); // walk the map, count flowing tiles, magma, water uint32_t flow1=0, flow2=0, flowboth=0, water=0, magma=0; - cout << "Counting flows and liquids ."; + cout << "Counting flows and liquids ..."; for(uint32_t x = 0; x< x_max;x++) { for(uint32_t y = 0; y< y_max;y++) @@ -69,18 +69,19 @@ int main (void) if (designations[i][j].bits.liquid_type == DFHack::liquid_water) water++; } - // Maps->WriteDesignations(x, y, z, &designations); - // Maps->WriteBlockFlags(x, y, z, bflags); - cout << "."; } } } } - cout << endl << "Done." << endl; cout << "Blocks with liquid_1=true: " << flow1 << endl; cout << "Blocks with liquid_2=true: " << flow2 << endl; cout << "Blocks with both: " << flowboth << endl; cout << "Water tiles: " << water << endl; cout << "Magma tiles: " << magma << endl; + + cout << endl << "Done." << endl; + #ifndef LINUX_BUILD + cin.ignore(); + #endif return 0; } diff --git a/tools/liquids.cpp b/tools/supported/liquids.cpp similarity index 100% rename from tools/liquids.cpp rename to tools/supported/liquids.cpp diff --git a/tools/probe.cpp b/tools/supported/probe.cpp similarity index 100% rename from tools/probe.cpp rename to tools/supported/probe.cpp diff --git a/tools/prospector.cpp b/tools/supported/prospector.cpp similarity index 100% rename from tools/prospector.cpp rename to tools/supported/prospector.cpp diff --git a/tools/reveal.cpp b/tools/supported/reveal.cpp similarity index 100% rename from tools/reveal.cpp rename to tools/supported/reveal.cpp diff --git a/examples/suspendtest.cpp b/tools/supported/suspendtest.cpp similarity index 100% rename from examples/suspendtest.cpp rename to tools/supported/suspendtest.cpp diff --git a/tools/unstuck.cpp b/tools/supported/unstuck.cpp similarity index 100% rename from tools/unstuck.cpp rename to tools/supported/unstuck.cpp diff --git a/tools/vdig.cpp b/tools/supported/vdig.cpp similarity index 100% rename from tools/vdig.cpp rename to tools/supported/vdig.cpp