2015-01-22 21:05:46 -07:00
######################
Contributing to DFHACK
######################
.. contents ::
Contributing to DFHack
======================
Several things should be kept in mind when contributing to DFHack.
2015-01-27 13:12:46 -07:00
-----------
Code Format
-----------
2015-01-22 21:05:46 -07:00
2015-01-31 20:50:37 -07:00
* Four space indents for C++. Never use tabs for indentation in any language.
2015-01-22 21:05:46 -07:00
* LF (Unix style) line terminators
2015-01-31 19:38:42 -07:00
* Avoid trailing whitespace
2015-01-22 21:05:46 -07:00
* UTF-8 encoding
2015-01-27 13:12:46 -07:00
* For C++:
2015-01-31 19:38:42 -07:00
* Opening and closing braces on their own lines or opening brace at the end of the previous line
2015-01-31 21:04:35 -07:00
* Braces placed at original indent level if on their own lines
2015-01-31 21:06:23 -07:00
* #includes should be sorted. C++ libraries first, then dfhack modules, then df structures, then local includes. Within each category they should be sorted alphabetically. This policy is currently broken by most C++ files but try to follow it if you can.
2015-01-22 21:05:46 -07:00
-------------------------------
How to get new code into DFHack
-------------------------------
2015-01-31 19:38:42 -07:00
* Submit pull requests to the develop branch, not the master branch. The master branch always points at the most recent release.
* Use new branches for each feature/fix so that your changes can be merged independently.
2015-01-22 21:05:46 -07:00
* If possible, compile on multiple platforms
* Do update NEWS/Contributors.rst
2015-01-31 19:38:42 -07:00
* Do **NOT** run fix-texts.sh or update .html files (except to locally test changes to .rst files)
2015-01-22 21:05:46 -07:00
* Create a Github Pull Request once finished
* Work done against `issues <http://github.com/DFHack/dfhack/issues> `_ that are tagged "bug report" gets priority
2015-01-31 19:38:42 -07:00
* Submit ideas and bug reports as issues on github. Posts in the forum thread are also acceptable but can get missed or forgotten more easily.
2015-01-22 21:05:46 -07:00
---------------
Memory research
---------------
If you want to do memory research, you'll need some tools and some knowledge.
In general, you'll need a good memory viewer and optionally something
to look at machine code without getting crazy :)
Good windows tools include:
* Cheat Engine
* IDA Pro 5.0 (freely available for non-commercial use)
Good linux tools:
* angavrilov's df-structures gui (visit us on IRC for details).
* edb (Evan's Debugger)
* IDA Pro 5.0 running under Wine
* Some of the tools residing in the `` legacy `` dfhack branch.
2015-01-31 19:38:42 -07:00
Using publicly known information and analyzing the game's data is preferred.