Many tweaks to plugins, reorganized the build system and removed more cruft.

develop
Petr Mrázek 2011-08-14 08:42:21 +02:00
parent 02ea81c0b3
commit a0f99ef707
17 changed files with 222 additions and 162 deletions

@ -9,79 +9,65 @@ ${dfhack_SOURCE_DIR}/CMake/Modules
${CMAKE_MODULE_PATH} ${CMAKE_MODULE_PATH}
) )
# mixing the build system with the source code is ugly and stupid. enforce the opposite :)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not allowed.") message(FATAL_ERROR "In-source builds are not allowed.")
endif() endif()
set(DF_VERSION_MAJOR "0") ## setting the build type.
set(DF_VERSION_MINOR "31")
set(DF_VERSION_PATCH "25")
set(DFHACK_RELEASE "1")
set(DF_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}")
## setting the build type
IF(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "") IF(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Release RelWithDebInfo.") SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Release RelWithDebInfo.")
ENDIF() ENDIF()
SET(DFHACK_OUTPUT_DIR "${dfhack_BINARY_DIR}/bin" CACHE STRING "Where should be the produced libraries and binaries stored.") # set up versioning.
SET(DFHACK_PLUGIN_OUTPUT_DIR "${DFHACK_OUTPUT_DIR}/plugins") set(DF_VERSION_MAJOR "0")
set(DF_VERSION_MINOR "31")
set(DF_VERSION_PATCH "25")
set(DF_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}")
## where to put things during the build (force MSVC to behave) set(DFHACK_RELEASE "1")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${DFHACK_OUTPUT_DIR})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${DFHACK_OUTPUT_DIR})
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${DFHACK_OUTPUT_DIR})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${DFHACK_OUTPUT_DIR})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${DFHACK_OUTPUT_DIR})
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${DFHACK_OUTPUT_DIR})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${DFHACK_OUTPUT_DIR})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL ${DFHACK_OUTPUT_DIR})
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL ${DFHACK_OUTPUT_DIR})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${DFHACK_OUTPUT_DIR})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${DFHACK_OUTPUT_DIR})
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${DFHACK_OUTPUT_DIR})
## where to install things (after the build is done, classic 'make install' or package structure) ## where to install things (after the build is done, classic 'make install' or package structure)
# the dfhack libraries will be installed here: # the dfhack libraries will be installed here:
SET(DFHACK_LIBRARY_DESTINATION .)
# the dfhack tools will be installed here:
SET(DFHACK_BINARY_DESTINATION .)
# Memory.xml goes here:
SET(DFHACK_DATA_DESTINATION .)
# Plugins go here
SET(DFHACK_PLUGIN_DESTINATION plugins)
# Includes go here:
SET(DFHACK_INCLUDES_DESTINATION dev/include)
# the Windows .lib files go here:
IF(WIN32)
SET(DFHACK_DEVLIB_DESTINATION dev)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
ENDIF()
IF(UNIX) IF(UNIX)
SET(CMAKE_INSTALL_RPATH "$ORIGIN") # put the lib into DF/hack
SET(DFHACK_LIBRARY_DESTINATION hack)
ELSE()
# windows is crap, therefore we can't do nice things with it. leave the libs on a nasty pile...
SET(DFHACK_LIBRARY_DESTINATION .)
ENDIF() ENDIF()
# external tools will be installed here:
# documentation goes here: SET(DFHACK_BINARY_DESTINATION .)
SET(DFHACK_USERDOC_DESTINATION .) # dfhack data goes here:
SET(DFHACK_DEVDOC_DESTINATION dev) SET(DFHACK_DATA_DESTINATION hack)
SET(DFHACK_DOXYGEN_DESTINATION dev/doxygen) # plugin libs go here:
SET(DFHACK_PLUGIN_DESTINATION hack/plugins)
# dfhack header files go here:
SET(DFHACK_INCLUDES_DESTINATION hack/include)
# the windows .lib file goes here:
SET(DFHACK_DEVLIB_DESTINATION hack)
# user documentation goes here:
SET(DFHACK_USERDOC_DESTINATION hack)
# developer documentation goes here:
SET(DFHACK_DEVDOC_DESTINATION hack)
## some options for the user/developer to play with ## some options for the user/developer to play with
OPTION(BUILD_LIBRARY "Build the library that goes into DF." ON) OPTION(BUILD_LIBRARY "Build the library that goes into DF." ON)
OPTION(BUILD_PLUGINS "Build the plugins." ON) OPTION(BUILD_PLUGINS "Build the plugins." ON)
# build the static lua # build the static lua for dfusion
INCLUDE_DIRECTORIES ( lua/include ) INCLUDE_DIRECTORIES ( lua/include )
add_subdirectory (lua) add_subdirectory (lua)
# build the lib itself
IF(BUILD_LIBRARY) IF(BUILD_LIBRARY)
#add_subdirectory (dlib)
add_subdirectory (library) add_subdirectory (library)
## install the default documentation files ## install the default documentation files
install(FILES LICENSE Readme.html DESTINATION ${DFHACK_USERDOC_DESTINATION}) install(FILES LICENSE Readme.html Compile.html DESTINATION ${DFHACK_USERDOC_DESTINATION})
endif() endif()
#build the plugins
IF(BUILD_PLUGINS) IF(BUILD_PLUGINS)
add_subdirectory (plugins) add_subdirectory (plugins)
endif() endif()
@ -89,14 +75,8 @@ endif()
# Packaging with CPack! # Packaging with CPack!
IF(UNIX) IF(UNIX)
SET(CPACK_GENERATOR "TGZ") SET(CPACK_GENERATOR "TGZ")
ENDIF() ELSEIF(WIN32)
IF(WIN32)
SET(CPACK_GENERATOR "ZIP") SET(CPACK_GENERATOR "ZIP")
# this includes the MSVC C++ DLLs in the package. Doesn't work with Express versions in general.
# we should be fine with the stuff DF already has packaged... so, commenting out
# INCLUDE(InstallRequiredSystemLibraries)
ENDIF() ENDIF()
set(CPACK_PACKAGE_FILE_NAME "dfhack-${DF_VERSION}-r${DFHACK_RELEASE}-${CMAKE_SYSTEM_NAME}") set(CPACK_PACKAGE_FILE_NAME "dfhack-${DF_VERSION}-r${DFHACK_RELEASE}-${CMAKE_SYSTEM_NAME}")
INCLUDE(CPack) INCLUDE(CPack)

@ -108,6 +108,22 @@ deramp (by zilpin)
Removes all ramps designated for removal from the map. This is useful for replicating the old channel digging designation. Removes all ramps designated for removal from the map. This is useful for replicating the old channel digging designation.
It also removes any and all 'down ramps' that can remain after a cave-in (you don't have to designate anything for that to happen). It also removes any and all 'down ramps' that can remain after a cave-in (you don't have to designate anything for that to happen).
dfusion
=======
This is the DFusion lua plugin system by warmist/darius, running as a DFHack plugin.
See the bay12 thread for details: http://www.bay12forums.com/smf/index.php?topic=69682.15
Confirmed working DFusion plugins:
----------------------------------
:simple_embark:allows changing the number of dwarves available on embark.
.. note::
* Some of the DFusion plugins aren't completely ported yet. This can lead to crashes.
* This is currently working only on Windows.
* The game will be suspended while you're using dfusion. Don't panic when it doen't respond.
flows flows
===== =====
A tool for checking how many tiles contain flowing liquids. If you suspect that your magma sea leaks into HFS, you can use this tool to be sure without revealing the map. A tool for checking how many tiles contain flowing liquids. If you suspect that your magma sea leaks into HFS, you can use this tool to be sure without revealing the map.
@ -197,7 +213,7 @@ This is an isometric visualizer that is runs in a second window.
This requires working graphics acceleration, at least a dual core CPU (otherwise it will slow down DF) and on Linux, the allegro 5 libraries installed (look for 'allegro5' in your package manager app). This requires working graphics acceleration, at least a dual core CPU (otherwise it will slow down DF) and on Linux, the allegro 5 libraries installed (look for 'allegro5' in your package manager app).
For further details, see the contents of 'DF/stonesense'. All the data resides in the 'stonesense' directory.
Older versions, support and extra graphics can be found in the bay12 forum thread: Older versions, support and extra graphics can be found in the bay12 forum thread:
http://www.bay12forums.com/smf/index.php?topic=43260.0 http://www.bay12forums.com/smf/index.php?topic=43260.0

@ -346,30 +346,34 @@ access DF memory and allow for easier development of new tools.</p>
</ul> </ul>
</li> </li>
<li><a class="reference internal" href="#deramp-by-zilpin" id="id18">deramp (by zilpin)</a></li> <li><a class="reference internal" href="#deramp-by-zilpin" id="id18">deramp (by zilpin)</a></li>
<li><a class="reference internal" href="#flows" id="id19">flows</a></li> <li><a class="reference internal" href="#dfusion" id="id19">dfusion</a><ul>
<li><a class="reference internal" href="#grow" id="id20">grow</a></li> <li><a class="reference internal" href="#confirmed-working-dfusion-plugins" id="id20">Confirmed working DFusion plugins:</a></li>
<li><a class="reference internal" href="#extirpate" id="id21">extirpate</a><ul>
<li><a class="reference internal" href="#id3" id="id22">Options</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference internal" href="#immolate" id="id23">immolate</a></li> <li><a class="reference internal" href="#flows" id="id21">flows</a></li>
<li><a class="reference internal" href="#liquids" id="id24">liquids</a></li> <li><a class="reference internal" href="#grow" id="id22">grow</a></li>
<li><a class="reference internal" href="#mode" id="id25">mode</a></li> <li><a class="reference internal" href="#extirpate" id="id23">extirpate</a><ul>
<li><a class="reference internal" href="#forcepause" id="id26">forcepause</a></li> <li><a class="reference internal" href="#id3" id="id24">Options</a></li>
<li><a class="reference internal" href="#die" id="id27">die</a></li>
<li><a class="reference internal" href="#probe" id="id28">probe</a></li>
<li><a class="reference internal" href="#prospector" id="id29">prospector</a><ul>
<li><a class="reference internal" href="#id4" id="id30">Options</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference internal" href="#reveal" id="id31">reveal</a></li> <li><a class="reference internal" href="#immolate" id="id25">immolate</a></li>
<li><a class="reference internal" href="#unreveal" id="id32">unreveal</a></li> <li><a class="reference internal" href="#liquids" id="id26">liquids</a></li>
<li><a class="reference internal" href="#revtoggle" id="id33">revtoggle</a></li> <li><a class="reference internal" href="#mode" id="id27">mode</a></li>
<li><a class="reference internal" href="#revflood" id="id34">revflood</a></li> <li><a class="reference internal" href="#forcepause" id="id28">forcepause</a></li>
<li><a class="reference internal" href="#ssense-stonesense" id="id35">ssense / stonesense</a></li> <li><a class="reference internal" href="#die" id="id29">die</a></li>
<li><a class="reference internal" href="#tubefill" id="id36">tubefill</a></li> <li><a class="reference internal" href="#probe" id="id30">probe</a></li>
<li><a class="reference internal" href="#vdig" id="id37">vdig</a></li> <li><a class="reference internal" href="#prospector" id="id31">prospector</a><ul>
<li><a class="reference internal" href="#weather" id="id38">weather</a></li> <li><a class="reference internal" href="#id4" id="id32">Options</a></li>
</ul>
</li>
<li><a class="reference internal" href="#reveal" id="id33">reveal</a></li>
<li><a class="reference internal" href="#unreveal" id="id34">unreveal</a></li>
<li><a class="reference internal" href="#revtoggle" id="id35">revtoggle</a></li>
<li><a class="reference internal" href="#revflood" id="id36">revflood</a></li>
<li><a class="reference internal" href="#ssense-stonesense" id="id37">ssense / stonesense</a></li>
<li><a class="reference internal" href="#tubefill" id="id38">tubefill</a></li>
<li><a class="reference internal" href="#vdig" id="id39">vdig</a></li>
<li><a class="reference internal" href="#weather" id="id40">weather</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -487,20 +491,37 @@ By default, owned food on the floor and rotten items are confistacted and dumped
<p>Removes all ramps designated for removal from the map. This is useful for replicating the old channel digging designation. <p>Removes all ramps designated for removal from the map. This is useful for replicating the old channel digging designation.
It also removes any and all 'down ramps' that can remain after a cave-in (you don't have to designate anything for that to happen).</p> It also removes any and all 'down ramps' that can remain after a cave-in (you don't have to designate anything for that to happen).</p>
</div> </div>
<div class="section" id="dfusion">
<h2><a class="toc-backref" href="#id19">dfusion</a></h2>
<p>This is the DFusion lua plugin system by warmist/darius, running as a DFHack plugin.</p>
<p>See the bay12 thread for details: <a class="reference external" href="http://www.bay12forums.com/smf/index.php?topic=69682.15">http://www.bay12forums.com/smf/index.php?topic=69682.15</a></p>
<div class="section" id="confirmed-working-dfusion-plugins">
<h3><a class="toc-backref" href="#id20">Confirmed working DFusion plugins:</a></h3>
<p>:simple_embark:allows changing the number of dwarves available on embark.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<ul class="last simple">
<li>Some of the DFusion plugins aren't completely ported yet. This can lead to crashes.</li>
<li>This is currently working only on Windows.</li>
<li>The game will be suspended while you're using dfusion. Don't panic when it doen't respond.</li>
</ul>
</div>
</div>
</div>
<div class="section" id="flows"> <div class="section" id="flows">
<h2><a class="toc-backref" href="#id19">flows</a></h2> <h2><a class="toc-backref" href="#id21">flows</a></h2>
<p>A tool for checking how many tiles contain flowing liquids. If you suspect that your magma sea leaks into HFS, you can use this tool to be sure without revealing the map.</p> <p>A tool for checking how many tiles contain flowing liquids. If you suspect that your magma sea leaks into HFS, you can use this tool to be sure without revealing the map.</p>
</div> </div>
<div class="section" id="grow"> <div class="section" id="grow">
<h2><a class="toc-backref" href="#id20">grow</a></h2> <h2><a class="toc-backref" href="#id22">grow</a></h2>
<p>Makes all saplings present on the map grow into trees (almost) instantly.</p> <p>Makes all saplings present on the map grow into trees (almost) instantly.</p>
</div> </div>
<div class="section" id="extirpate"> <div class="section" id="extirpate">
<h2><a class="toc-backref" href="#id21">extirpate</a></h2> <h2><a class="toc-backref" href="#id23">extirpate</a></h2>
<p>A tool for getting rid of trees and shrubs. By default, it only kills a tree/shrub under the cursor. <p>A tool for getting rid of trees and shrubs. By default, it only kills a tree/shrub under the cursor.
The plants are turned into ashes instantly.</p> The plants are turned into ashes instantly.</p>
<div class="section" id="id3"> <div class="section" id="id3">
<h3><a class="toc-backref" href="#id22">Options</a></h3> <h3><a class="toc-backref" href="#id24">Options</a></h3>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
<col class="field-body" /> <col class="field-body" />
@ -516,11 +537,11 @@ The plants are turned into ashes instantly.</p>
</div> </div>
</div> </div>
<div class="section" id="immolate"> <div class="section" id="immolate">
<h2><a class="toc-backref" href="#id23">immolate</a></h2> <h2><a class="toc-backref" href="#id25">immolate</a></h2>
<p>Very similar to extirpate, but additionally sets the plants on fire. The fires can and <em>will</em> spread ;)</p> <p>Very similar to extirpate, but additionally sets the plants on fire. The fires can and <em>will</em> spread ;)</p>
</div> </div>
<div class="section" id="liquids"> <div class="section" id="liquids">
<h2><a class="toc-backref" href="#id24">liquids</a></h2> <h2><a class="toc-backref" href="#id26">liquids</a></h2>
<p>Allows adding magma, water and obsidian to the game. It replaces the normal dfhack command line and can't be used from a hotkey. <p>Allows adding magma, water and obsidian to the game. It replaces the normal dfhack command line and can't be used from a hotkey.
For more information, refer to the command's internal help.</p> For more information, refer to the command's internal help.</p>
<div class="note"> <div class="note">
@ -530,7 +551,7 @@ temperatures (creating heat traps). You've been warned.</p>
</div> </div>
</div> </div>
<div class="section" id="mode"> <div class="section" id="mode">
<h2><a class="toc-backref" href="#id25">mode</a></h2> <h2><a class="toc-backref" href="#id27">mode</a></h2>
<p>This command lets you see and change the game mode directly. Not all combinations are good for every situation and most of them will produce undesirable results. <p>This command lets you see and change the game mode directly. Not all combinations are good for every situation and most of them will produce undesirable results.
There are a few good ones though.</p> There are a few good ones though.</p>
<div class="admonition-example admonition"> <div class="admonition-example admonition">
@ -542,22 +563,22 @@ You just lost a fortress and gained an adventurer.</p>
<p>I take no responsibility of anything that happens as a result of using this tool :P</p> <p>I take no responsibility of anything that happens as a result of using this tool :P</p>
</div> </div>
<div class="section" id="forcepause"> <div class="section" id="forcepause">
<h2><a class="toc-backref" href="#id26">forcepause</a></h2> <h2><a class="toc-backref" href="#id28">forcepause</a></h2>
<p>Forces DF to pause. This is useful when your FPS drops below 1 and you lose control of the game.</p> <p>Forces DF to pause. This is useful when your FPS drops below 1 and you lose control of the game.</p>
</div> </div>
<div class="section" id="die"> <div class="section" id="die">
<h2><a class="toc-backref" href="#id27">die</a></h2> <h2><a class="toc-backref" href="#id29">die</a></h2>
<p>Instantly kills DF without saving.</p> <p>Instantly kills DF without saving.</p>
</div> </div>
<div class="section" id="probe"> <div class="section" id="probe">
<h2><a class="toc-backref" href="#id28">probe</a></h2> <h2><a class="toc-backref" href="#id30">probe</a></h2>
<p>Can be used to determine tile properties like temperature.</p> <p>Can be used to determine tile properties like temperature.</p>
</div> </div>
<div class="section" id="prospector"> <div class="section" id="prospector">
<h2><a class="toc-backref" href="#id29">prospector</a></h2> <h2><a class="toc-backref" href="#id31">prospector</a></h2>
<p>Lists all available minerals on the map and how much of them there is. By default, only processes the already discovered part of the map.</p> <p>Lists all available minerals on the map and how much of them there is. By default, only processes the already discovered part of the map.</p>
<div class="section" id="id4"> <div class="section" id="id4">
<h3><a class="toc-backref" href="#id30">Options</a></h3> <h3><a class="toc-backref" href="#id32">Options</a></h3>
<table class="docutils field-list" frame="void" rules="none"> <table class="docutils field-list" frame="void" rules="none">
<col class="field-name" /> <col class="field-name" />
<col class="field-body" /> <col class="field-body" />
@ -569,41 +590,41 @@ You just lost a fortress and gained an adventurer.</p>
</div> </div>
</div> </div>
<div class="section" id="reveal"> <div class="section" id="reveal">
<h2><a class="toc-backref" href="#id31">reveal</a></h2> <h2><a class="toc-backref" href="#id33">reveal</a></h2>
<p>This reveals the map. By default, HFS will remain hidden so that the demons don't spawn. You can use 'reveal hell' to reveal everything. With hell revealed, you won't be able to unpause until you hide the map again.</p> <p>This reveals the map. By default, HFS will remain hidden so that the demons don't spawn. You can use 'reveal hell' to reveal everything. With hell revealed, you won't be able to unpause until you hide the map again.</p>
</div> </div>
<div class="section" id="unreveal"> <div class="section" id="unreveal">
<h2><a class="toc-backref" href="#id32">unreveal</a></h2> <h2><a class="toc-backref" href="#id34">unreveal</a></h2>
<p>Reverts the effects of 'reveal'.</p> <p>Reverts the effects of 'reveal'.</p>
</div> </div>
<div class="section" id="revtoggle"> <div class="section" id="revtoggle">
<h2><a class="toc-backref" href="#id33">revtoggle</a></h2> <h2><a class="toc-backref" href="#id35">revtoggle</a></h2>
<p>Switches between 'reveal' and 'unreveal'.</p> <p>Switches between 'reveal' and 'unreveal'.</p>
</div> </div>
<div class="section" id="revflood"> <div class="section" id="revflood">
<h2><a class="toc-backref" href="#id34">revflood</a></h2> <h2><a class="toc-backref" href="#id36">revflood</a></h2>
<p>This command will hide the whole map and then reveal all the tiles that have a path to the in-game cursor.</p> <p>This command will hide the whole map and then reveal all the tiles that have a path to the in-game cursor.</p>
</div> </div>
<div class="section" id="ssense-stonesense"> <div class="section" id="ssense-stonesense">
<h2><a class="toc-backref" href="#id35">ssense / stonesense</a></h2> <h2><a class="toc-backref" href="#id37">ssense / stonesense</a></h2>
<p>This is an isometric visualizer that is runs in a second window.</p> <p>This is an isometric visualizer that is runs in a second window.</p>
<p>This requires working graphics acceleration, at least a dual core CPU (otherwise it will slow down DF) and on Linux, the allegro 5 libraries installed (look for 'allegro5' in your package manager app).</p> <p>This requires working graphics acceleration, at least a dual core CPU (otherwise it will slow down DF) and on Linux, the allegro 5 libraries installed (look for 'allegro5' in your package manager app).</p>
<p>For further details, see the contents of 'DF/stonesense'.</p> <p>All the data resides in the 'stonesense' directory.</p>
<p>Older versions, support and extra graphics can be found in the bay12 forum thread: <p>Older versions, support and extra graphics can be found in the bay12 forum thread:
<a class="reference external" href="http://www.bay12forums.com/smf/index.php?topic=43260.0">http://www.bay12forums.com/smf/index.php?topic=43260.0</a></p> <a class="reference external" href="http://www.bay12forums.com/smf/index.php?topic=43260.0">http://www.bay12forums.com/smf/index.php?topic=43260.0</a></p>
<p>Some additional resources: <p>Some additional resources:
<a class="reference external" href="http://df.magmawiki.com/index.php/Utility:Stonesense/Content_repository">http://df.magmawiki.com/index.php/Utility:Stonesense/Content_repository</a></p> <a class="reference external" href="http://df.magmawiki.com/index.php/Utility:Stonesense/Content_repository">http://df.magmawiki.com/index.php/Utility:Stonesense/Content_repository</a></p>
</div> </div>
<div class="section" id="tubefill"> <div class="section" id="tubefill">
<h2><a class="toc-backref" href="#id36">tubefill</a></h2> <h2><a class="toc-backref" href="#id38">tubefill</a></h2>
<p>Fills all the adamantine veins again. Veins that were empty will be filled in too, but might still trigger a demon invasion (this is a known bug).</p> <p>Fills all the adamantine veins again. Veins that were empty will be filled in too, but might still trigger a demon invasion (this is a known bug).</p>
</div> </div>
<div class="section" id="vdig"> <div class="section" id="vdig">
<h2><a class="toc-backref" href="#id37">vdig</a></h2> <h2><a class="toc-backref" href="#id39">vdig</a></h2>
<p>Designates a whole vein for digging. Requires an active in-game cursor placed over a vein tile. With the 'x' option, it will traverse z-levels (putting stairs between the same-material tiles).</p> <p>Designates a whole vein for digging. Requires an active in-game cursor placed over a vein tile. With the 'x' option, it will traverse z-levels (putting stairs between the same-material tiles).</p>
</div> </div>
<div class="section" id="weather"> <div class="section" id="weather">
<h2><a class="toc-backref" href="#id38">weather</a></h2> <h2><a class="toc-backref" href="#id40">weather</a></h2>
<p>Lets you change the current weather to 'clear sky', 'rainy' or 'snowing'. <p>Lets you change the current weather to 'clear sky', 'rainy' or 'snowing'.
Fill those ponds without mucking around with dfliquids :D Rain can also stop brush fires.</p> Fill those ponds without mucking around with dfliquids :D Rain can also stop brush fires.</p>
</div> </div>

@ -122,13 +122,10 @@ IF(UNIX)
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall") SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -m32 -std=c++0x") SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -m32 -std=c++0x")
SET(CMAKE_C_FLAGS "-fvisibility=hidden -m32") SET(CMAKE_C_FLAGS "-fvisibility=hidden -m32")
SET(PROJECT_LIBS rt ) SET(PROJECT_LIBS rt )
ELSE() ELSE()
IF(MSVC) IF(MSVC)
SET(PROJECT_LIBS psapi ${dfhack_SOURCE_DIR}/library/depends/ntdll/ntdll.lib) SET(PROJECT_LIBS psapi ${dfhack_SOURCE_DIR}/library/depends/ntdll/ntdll.lib)
ELSE()
SET(PROJECT_LIBS psapi ntdll)
ENDIF() ENDIF()
ENDIF() ENDIF()
@ -138,40 +135,26 @@ IF(WIN32)
SET_TARGET_PROPERTIES(dfhack PROPERTIES OUTPUT_NAME "SDL" ) SET_TARGET_PROPERTIES(dfhack PROPERTIES OUTPUT_NAME "SDL" )
ENDIF() ENDIF()
#effectively disables debug builds...
SET_TARGET_PROPERTIES(dfhack PROPERTIES DEBUG_POSTFIX "-debug" ) SET_TARGET_PROPERTIES(dfhack PROPERTIES DEBUG_POSTFIX "-debug" )
TARGET_LINK_LIBRARIES(dfhack ${PROJECT_LIBS}) TARGET_LINK_LIBRARIES(dfhack ${PROJECT_LIBS})
ADD_CUSTOM_TARGET( prepare
DEPENDS ${dfhack_SOURCE_DIR}/Memory.xml
COMMAND ${CMAKE_COMMAND} -E make_directory ${DFHACK_OUTPUT_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${DFHACK_PLUGIN_OUTPUT_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${dfhack_SOURCE_DIR}/Memory.xml ${DFHACK_OUTPUT_DIR})
ADD_DEPENDENCIES(dfhack prepare)
# On linux, copy our version of the df launch script which sets LD_PRELOAD
IF(UNIX) IF(UNIX)
ADD_CUSTOM_TARGET( prepare_UNIX # On linux, copy our version of the df launch script which sets LD_PRELOAD
DEPENDS ${dfhack_SOURCE_DIR}/package/linux/dfhack
COMMAND ${CMAKE_COMMAND} -E make_directory ${DFHACK_OUTPUT_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${dfhack_SOURCE_DIR}/package/linux/dfhack ${DFHACK_OUTPUT_DIR})
ADD_DEPENDENCIES(dfhack prepare_UNIX)
install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/dfhack install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/dfhack
DESTINATION ${DFHACK_LIBRARY_DESTINATION}) DESTINATION .)
ELSE() ELSE()
# On windows, copy the renamed SDL so DF can still run. # On windows, copy the renamed SDL so DF can still run.
ADD_CUSTOM_TARGET( prepare_WINDOWS
DEPENDS ${dfhack_SOURCE_DIR}/package/windows/SDLreal.dll
COMMAND ${CMAKE_COMMAND} -E make_directory ${DFHACK_OUTPUT_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${dfhack_SOURCE_DIR}/package/windows/SDLreal.dll ${DFHACK_OUTPUT_DIR})
ADD_DEPENDENCIES(dfhack prepare_WINDOWS)
install(PROGRAMS ${dfhack_SOURCE_DIR}/package/windows/SDLreal.dll install(PROGRAMS ${dfhack_SOURCE_DIR}/package/windows/SDLreal.dll
DESTINATION ${DFHACK_LIBRARY_DESTINATION}) DESTINATION ${DFHACK_LIBRARY_DESTINATION})
ENDIF() ENDIF()
#install the main lib
install(TARGETS dfhack install(TARGETS dfhack
LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION} LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION}
RUNTIME DESTINATION ${DFHACK_LIBRARY_DESTINATION}) #linux: lib RUNTIME DESTINATION ${DFHACK_LIBRARY_DESTINATION})
#install the offset file
install(FILES ${dfhack_SOURCE_DIR}/Memory.xml install(FILES ${dfhack_SOURCE_DIR}/Memory.xml
DESTINATION ${DFHACK_DATA_DESTINATION}) #linux: share/dfhack DESTINATION ${DFHACK_DATA_DESTINATION}) #linux: share/dfhack

@ -399,7 +399,12 @@ bool Core::Init()
return true; return true;
// find out what we are... // find out what we are...
vif = new DFHack::VersionInfoFactory("Memory.xml"); #ifdef LINUX_BUILD
const char * path = "hack/Memory.xml";
#else
const char * path = "hack\\Memory.xml";
#endif
vif = new DFHack::VersionInfoFactory(path);
p = new DFHack::Process(vif); p = new DFHack::Process(vif);
vinfo = p->getDescriptor(); vinfo = p->getDescriptor();
// dump offsets to a file // dump offsets to a file

@ -307,10 +307,10 @@ Plugin::plugin_state Plugin::getState() const
PluginManager::PluginManager(Core * core) PluginManager::PluginManager(Core * core)
{ {
#ifdef LINUX_BUILD #ifdef LINUX_BUILD
string path = core->p->getPath() + "/plugins/"; string path = core->p->getPath() + "/hack/plugins/";
const string searchstr = ".plug.so"; const string searchstr = ".plug.so";
#else #else
string path = core->p->getPath() + "\\plugins\\"; string path = core->p->getPath() + "\\hack\\plugins\\";
const string searchstr = ".plug.dll"; const string searchstr = ".plug.dll";
#endif #endif
cmdlist_mutex = new mutex(); cmdlist_mutex = new mutex();

@ -48,7 +48,7 @@ IF(DOXYGEN_FOUND)
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
INSTALL( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/" DESTINATION ${DFHACK_DOXYGEN_DESTINATION} ) INSTALL( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/" DESTINATION ${DFHACK_DEVDOC_DESTINATION}/doxygen )
INSTALL( FILES "Doxygen.html" DESTINATION ${DFHACK_DEVDOC_DESTINATION}) INSTALL( FILES "Doxygen.html" DESTINATION ${DFHACK_DEVDOC_DESTINATION})
ELSE(DOXYGEN_FOUND) ELSE(DOXYGEN_FOUND)
MESSAGE (WARNING "Doxygen binary couldn't be found. Can't build development documentation.'") MESSAGE (WARNING "Doxygen binary couldn't be found. Can't build development documentation.'")

@ -38,28 +38,28 @@ fi
case "$1" in case "$1" in
-g | --gdb) -g | --gdb)
shift shift
echo "set environment LD_PRELOAD=./libdfhack.so" > gdbcmd.tmp echo "set environment LD_PRELOAD=./hack/libdfhack.so" > gdbcmd.tmp
gdb $DF_GDB_OPTS -x gdbcmd.tmp ./libs/Dwarf_Fortress $* gdb $DF_GDB_OPTS -x gdbcmd.tmp ./libs/Dwarf_Fortress $*
rm gdbcmd.tmp rm gdbcmd.tmp
ret=$? ret=$?
;; ;;
-h | --helgrind) -h | --helgrind)
shift shift
LD_PRELOAD=./libdfhack.so setarch i386 -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./libs/Dwarf_Fortress $* LD_PRELOAD=./hack/libdfhack.so setarch i386 -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./libs/Dwarf_Fortress $*
ret=$? ret=$?
;; ;;
-v | --valgrind) -v | --valgrind)
shift shift
LD_PRELOAD=./libdfhack.so setarch i386 -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./libs/Dwarf_Fortress $* LD_PRELOAD=./hack/libdfhack.so setarch i386 -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./libs/Dwarf_Fortress $*
ret=$? ret=$?
;; ;;
-c | --callgrind) -c | --callgrind)
shift shift
LD_PRELOAD=./libdfhack.so setarch i386 -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./libs/Dwarf_Fortress $* LD_PRELOAD=./hack/libdfhack.so setarch i386 -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./libs/Dwarf_Fortress $*
ret=$? ret=$?
;; ;;
*) *)
LD_PRELOAD=./libdfhack.so setarch i386 -R ./libs/Dwarf_Fortress $* LD_PRELOAD=./hack/libdfhack.so setarch i386 -R ./libs/Dwarf_Fortress $*
ret=$? ret=$?
;; ;;
esac esac

@ -3,7 +3,7 @@ IF(UNIX)
add_definitions(-DLINUX_BUILD) add_definitions(-DLINUX_BUILD)
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall") SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -m32 -std=c++0x") SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -m32 -std=c++0x")
SET(CMAKE_C_FLAGS "-fvisibility=hidden -m32 -std=c++0x") SET(CMAKE_C_FLAGS "-fvisibility=hidden -m32")
ENDIF() ENDIF()
include_directories("${dfhack_SOURCE_DIR}/library/include") include_directories("${dfhack_SOURCE_DIR}/library/include")
@ -70,36 +70,18 @@ MACRO(DFHACK_PLUGIN)
ELSE() ELSE()
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES SUFFIX .plug.dll) SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES SUFFIX .plug.dll)
ENDIF() ENDIF()
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE ${DFHACK_PLUGIN_OUTPUT_DIR})
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL ${DFHACK_PLUGIN_OUTPUT_DIR})
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${DFHACK_PLUGIN_OUTPUT_DIR})
install(TARGETS ${PLUGIN_NAME} install(TARGETS ${PLUGIN_NAME}
LIBRARY DESTINATION ${DFHACK_PLUGIN_DESTINATION} LIBRARY DESTINATION ${DFHACK_PLUGIN_DESTINATION}
RUNTIME DESTINATION ${DFHACK_PLUGIN_DESTINATION}) RUNTIME DESTINATION ${DFHACK_PLUGIN_DESTINATION})
#MESSAGE("Depends: ${PLUGIN_DEPENDS}")
#IF (PLUGIN_AUTO_INSTALL)
# MESSAGE("Auto install")
#ENDIF (PLUGIN_AUTO_INSTALL)
#IF (PLUGIN_NO_MODULE)
# MESSAGE("No module")
#ENDIF (PLUGIN_NO_MODULE)
ENDMACRO(DFHACK_PLUGIN) ENDMACRO(DFHACK_PLUGIN)
# add all subdirectories. can be used in those subdirectories, etc...
# needs a re-run of cmake to pick up the changes
#macro(RECURSE_DIRS)
# file(GLOB sub-dir RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
# foreach(dir ${sub-dir})
# if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${dir})
# add_subdirectory (${dir})
# endif()
# endforeach()
#endmacro()
#RECURSE_DIRS()
# Dfusion plugin # Dfusion plugin
IF(UNIX)
OPTION(BUILD_DFUSION "Build DFusion." OFF)
ELSE()
OPTION(BUILD_DFUSION "Build DFusion." ON) OPTION(BUILD_DFUSION "Build DFusion." ON)
ENDIF()
if(BUILD_DFUSION) if(BUILD_DFUSION)
add_subdirectory (Dfusion) add_subdirectory (Dfusion)
endif() endif()

@ -7,4 +7,5 @@ set(
${DFUSION_CPPS} ${DFUSION_CPPS}
) )
DFHACK_PLUGIN(dfusion ${DFUSION_CPPS_ALL} LINK_LIBRARIES lua) DFHACK_PLUGIN(dfusion ${DFUSION_CPPS_ALL} LINK_LIBRARIES lua)
install(DIRECTORY luafiles/ DESTINATION ${DFHACK_DATA_DESTINATION}/dfusion) # installs into DF root
install(DIRECTORY luafiles/ DESTINATION dfusion)

@ -63,6 +63,8 @@ DFhackCExport command_result df_autodump (Core * c, vector <string> & parameters
"Items are instantly moved to the cursor position, the dump flag is unset,\n" "Items are instantly moved to the cursor position, the dump flag is unset,\n"
"and the forbid flag is set, as if it had been dumped normally.\n" "and the forbid flag is set, as if it had been dumped normally.\n"
"Be aware that any active dump item tasks still point at the item.\n\n" "Be aware that any active dump item tasks still point at the item.\n\n"
"Options:\n"
"destroy - instead of dumping, destroy the items instantly.\n"
); );
return CR_OK; return CR_OK;
} }

@ -56,8 +56,8 @@ DFhackCExport command_result df_deramp (Core * c, vector <string> & parameters)
if(parameters[i] == "help" || parameters[i] == "?") if(parameters[i] == "help" || parameters[i] == "?")
{ {
c->con.print("This command does two things:\n" c->con.print("This command does two things:\n"
"* If there are any ramps designated for removal, thyw will be instantly removed.\n" "If there are any ramps designated for removal, they will be instantly removed.\n"
"* Any ramps that don't have their counterpart will be removed (fixes bugs with caveins)\n" "Any ramps that don't have their counterpart will be removed (fixes bugs with caveins)\n"
); );
return CR_OK; return CR_OK;
} }

@ -24,7 +24,7 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand>
{ {
commands.clear(); commands.clear();
commands.push_back(PluginCommand("flows", commands.push_back(PluginCommand("flows",
"De-ramp. All ramps marked for removal are replaced with floors.", "Counts map blocks with flowing liquids.",
df_flows)); df_flows));
return CR_OK; return CR_OK;
} }
@ -41,7 +41,7 @@ DFhackCExport command_result df_flows (Core * c, vector <string> & parameters)
DFHack::Maps *Maps; DFHack::Maps *Maps;
c->Suspend(); c->Suspend();
Maps = c->getMaps();
// init the map // init the map
if(!Maps->Start()) if(!Maps->Start())
{ {

@ -101,6 +101,19 @@ DFhackCExport command_result plugin_shutdown ( Core * c )
DFhackCExport command_result reveal(DFHack::Core * c, std::vector<std::string> & params) DFhackCExport command_result reveal(DFHack::Core * c, std::vector<std::string> & params)
{ {
bool no_hell = true; bool no_hell = true;
for(int i = 0; i < params.size();i++)
{
if(params[i]=="hell")
no_hell = false;
else if(params[i] == "help" || params[i] == "?")
{
c->con.print("Reveals the map, by default ignoring hell.\n"
"Options:\n"
"hell - also reveal hell, while forcing the game to pause.\n"
);
return CR_OK;
}
}
if(params.size() && params[0] == "hell") if(params.size() && params[0] == "hell")
{ {
no_hell = false; no_hell = false;
@ -189,6 +202,14 @@ DFhackCExport command_result reveal(DFHack::Core * c, std::vector<std::string> &
DFhackCExport command_result unreveal(DFHack::Core * c, std::vector<std::string> & params) DFhackCExport command_result unreveal(DFHack::Core * c, std::vector<std::string> & params)
{ {
Console & con = c->con; Console & con = c->con;
for(int i = 0; i < params.size();i++)
{
if(params[i] == "help" || params[i] == "?")
{
c->con.print("Reverts the previous reveal operation, hiding the map again.\n");
return CR_OK;
}
}
if(!revealed) if(!revealed)
{ {
con.printerr("There's nothing to revert!\n"); con.printerr("There's nothing to revert!\n");
@ -244,6 +265,14 @@ DFhackCExport command_result unreveal(DFHack::Core * c, std::vector<std::string>
DFhackCExport command_result revtoggle (DFHack::Core * c, std::vector<std::string> & params) DFhackCExport command_result revtoggle (DFHack::Core * c, std::vector<std::string> & params)
{ {
for(int i = 0; i < params.size();i++)
{
if(params[i] == "help" || params[i] == "?")
{
c->con.print("Toggles between reveal and unreveal.\nCurrently it: ");
break;
}
}
if(revealed) if(revealed)
{ {
return unreveal(c,params); return unreveal(c,params);
@ -256,6 +285,16 @@ DFhackCExport command_result revtoggle (DFHack::Core * c, std::vector<std::strin
DFhackCExport command_result revflood(DFHack::Core * c, std::vector<std::string> & params) DFhackCExport command_result revflood(DFHack::Core * c, std::vector<std::string> & params)
{ {
for(int i = 0; i < params.size();i++)
{
if(params[i] == "help" || params[i] == "?")
{
c->con.print("This command hides the whole map. Then, starting from the cursor,\n"
"reveals all accessible tiles. Allows repairing parma-revealed maps.\n"
);
return CR_OK;
}
}
c->Suspend(); c->Suspend();
uint32_t x_max,y_max,z_max; uint32_t x_max,y_max,z_max;
Maps * Maps = c->getMaps(); Maps * Maps = c->getMaps();

@ -441,13 +441,24 @@ DFhackCExport command_result df_tiletypes (Core * c, vector <string> & parameter
DFHack::Maps *maps; DFHack::Maps *maps;
DFHack::Gui *gui; DFHack::Gui *gui;
for(int i = 0; i < parameters.size();i++)
{
if(parameters[i] == "help" || parameters[i] == "?")
{
c->con.print("This tool allows painting tiles types with a brush, using an optional filter.\n"
"The tool is interactive, similarly to the liquids tool.\n"
"Further help is available inside.\n"
);
return CR_OK;
}
}
TileType filter, paint; TileType filter, paint;
Brush *brush = new RectangleBrush(1,1); Brush *brush = new RectangleBrush(1,1);
bool end = false; bool end = false;
std::string brushname = "point"; std::string brushname = "point";
int width = 1, height = 1, z_levels = 1; int width = 1, height = 1, z_levels = 1;
c->con << "Welcome to the tiletype tool.\nType 'help' or '?' for a list of available commands, 'q' to quit.\nPress return after a command to confirm." << std::endl;
while (!end) while (!end)
{ {
c->con << "Filter: " << filter << std::endl c->con << "Filter: " << filter << std::endl

@ -44,7 +44,16 @@ DFhackCExport command_result tubefill(DFHack::Core * c, std::vector<std::string>
uint64_t count = 0; uint64_t count = 0;
int dirty=0; int dirty=0;
for(int i = 0; i < params.size();i++)
{
if(params[i] == "help" || params[i] == "?")
{
c->con.print("Replenishes mined out adamantine and hollow adamantine tubes.\n"
"May cause !!FUN!!\n"
);
return CR_OK;
}
}
c->Suspend(); c->Suspend();
DFHack::Maps *Mapz = c->getMaps(); DFHack::Maps *Mapz = c->getMaps();

@ -40,8 +40,19 @@ DFhackCExport command_result vdig (Core * c, vector <string> & parameters)
{ {
uint32_t x_max,y_max,z_max; uint32_t x_max,y_max,z_max;
bool updown = false; bool updown = false;
for(int i = 0; i < parameters.size();i++)
{
if(parameters.size() && parameters[0]=="x") if(parameters.size() && parameters[0]=="x")
updown = true; updown = true;
else if(parameters[i] == "help" || parameters[i] == "?")
{
c->con.print("Designates a whole vein under the cursor for digging.\n"
"Options:\n"
"x - follow veins through z-levels with stairs.\n"
);
return CR_OK;
}
}
Console & con = c->con; Console & con = c->con;