Skip to content

Commit cb86f52

Browse files
committed
minor liquids bugfix, added typedef for planecoord so that stonesense builds. Build system bits. Doxygen bits.
1 parent b6d0276 commit cb86f52

File tree

15 files changed

+438
-301
lines changed

15 files changed

+438
-301
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ENDIF(NOT DEFINED CMAKE_BUILD_TYPE)
2525
SET( LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack library" )
2626
SET( EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack tools" )
2727
SET( DATA_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output CACHE PATH "Output directory for the dfhack data (offset files)" )
28+
SET( DOXYGEN_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/output/doxygen CACHE PATH "Output directory for doxygen")
2829

2930
OPTION(BUILD_DFHACK_DOCUMENTATION "Create doxygen documentation for developers" OFF)
3031
OPTION(BUILD_DFHACK_EXAMPLES "Build example tools" OFF)

COMPILE.rst

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ is simple. Enter the build folder, run the tools. Like this::
2626
make
2727

2828
This will build the library and its tools and place them in ``/output``.
29+
30+
Alternatively, you can use ccmake instead of cmake:
31+
32+
cd build
33+
ccmake ..
34+
make
35+
36+
This will show a curses-based interface that lets you set all of the
37+
extra options.
38+
2939
You can also use a cmake-friendly IDE like KDevelop 4 or the cmake GUI
3040
program.
3141

@@ -133,3 +143,124 @@ Valid an useful build types include 'Release', 'Debug' and
133143
'RelWithDebInfo'. There are others, but they aren't really that useful.
134144

135145
Have fun.
146+
147+
================================
148+
Using the library as a developer
149+
================================
150+
DFHack is using the zlib/libpng license. This makes it easy to link to
151+
it, use it in-source or add your own extensions. Contributing back to
152+
the dfhack repository is welcome and the right thing to do :)
153+
154+
Rudimentary API documentation can be built using doxygen.
155+
156+
Contributing to DFHack
157+
======================
158+
159+
Several things should be kept in mind when contributing to DFHack.
160+
161+
------------
162+
Coding style
163+
------------
164+
DFhack uses ANSI formatting and four spaces as indentation. Line
165+
endings are UNIX. The files use UTF-8 encoding. Code not following this
166+
won't make me happy, because I'll have to fix it. There's a good chance
167+
I'll make *you* fix it ;)
168+
169+
-------------------------------
170+
How to get new code into DFHack
171+
-------------------------------
172+
You can send patches or make a clone of the github repo and ask me on
173+
the IRC channel to pull your code in. I'll review it and see if there
174+
are any problems. I'll fix them if they are minor.
175+
176+
Fixes are higher in priority. If you want to work on something, but
177+
don't know what, check out http://github.com/peterix/dfhack/issues --
178+
this is also a good place to dump new ideas and/or bugs that need
179+
fixing.
180+
181+
----------------
182+
Layout for tools
183+
----------------
184+
Tools live in the tools/ folder. There, they are split into three
185+
categories.
186+
187+
distributed
188+
these tools get distributed with binary releases and are installed
189+
by doing 'make install' on linux. They are supposed to be stable
190+
and supported. Experimental, useless, buggy or untested stuff
191+
doesn't belong here.
192+
examples
193+
examples are tools that aren't very useful, but show how DF and
194+
DFHack work. They should use only DFHack API functions. No actual
195+
hacking or 'magic offsets' are allowed.
196+
playground
197+
This is a catch-all folder for tools that aren't ready to be
198+
examples or be distributed in binary releases. All new tools should
199+
start here. They can contain actual hacking, magic values and other
200+
nasty business.
201+
202+
------------------------
203+
Modules - what are they?
204+
------------------------
205+
DFHack uses modules to partition sets of features into manageable
206+
chunks. A module can have both client and server side.
207+
208+
Client side is the part that goes into the main library and is
209+
generally written in C++. It is exposed to the users of DFHack.
210+
211+
Server side is used inside DF and serves to accelerate the client
212+
modules. This is written mostly in C style.
213+
214+
There's a Core module that shouldn't be changed, because it defines the
215+
basic commands like reading and writing raw data. The client parts for
216+
the Core module are the various implementations of the Process
217+
interface.
218+
219+
A good example of a module is Maps. Named the same in both client and
220+
server, it allows accelerating the reading of map blocks.
221+
222+
Communication between modules happens by using shared memory. This is
223+
pretty fast, but needs quite a bit of care to not break.
224+
225+
------------
226+
Dependencies
227+
------------
228+
Internal
229+
either part of the codebase or statically linked.
230+
External
231+
linked as dynamic loaded libraries (.dll, .so, etc.)
232+
233+
If you want to add dependencies, think twice about it. All internal
234+
dependencies for core dfhack should be either public domain or require
235+
attribution at most. External dependencies for tools can be either
236+
that, or any Free Software licenses.
237+
238+
Current internal dependencies
239+
-----------------------------
240+
tinyxml
241+
used by core dfhack to read offset definitions from Memory.xml
242+
md5
243+
an implementation of the MD5 hash algorithm. Used for identifying
244+
DF binaries on Linux.
245+
argstream
246+
Allows reading terminal application arguments. GPL!
247+
248+
Current external dependencies
249+
-----------------------------
250+
wide-character ncurses
251+
used for the veinlook tool on Linux.
252+
x11 libraries
253+
used for sending key events on linux
254+
255+
Build-time dependencies
256+
-----------------------
257+
cmake
258+
you need cmake to generate the build system and some configuration
259+
headers
260+
261+
=========================
262+
Memory offset definitions
263+
=========================
264+
The files with memory offset definitions used by dfhack can be found in the
265+
data folder.
266+

0 commit comments

Comments
 (0)