updated to Tree tuple type

develop
doomchild 2010-04-23 11:56:38 -05:00
parent cabe5d9271
commit 365c6dd0ed
1 changed files with 6 additions and 14 deletions

@ -33,24 +33,16 @@ using namespace DFHack;
static PyObject* BuildTree(DFHack::t_tree& tree)
{
PyObject* t_dict;
PyObject* temp;
PyObject* t_Obj;
PyObject* args;
t_dict = PyDict_New();
args = Py_BuildValue("iiOi", tree.type, tree.material, BuildPosition3D(tree.x, tree.y, tree.z), tree.address);
temp = PyInt_FromLong(tree.type);
DICTADD(t_dict, "type", temp);
t_Obj = PyObject_CallObject(Tree_type, args);
temp = PyInt_FromLong(tree.material);
DICTADD(t_dict, "material", temp);
Py_DECREF(args);
temp = PyTuple_Pack(3, tree.x, tree.y, tree.z);
DICTADD(t_dict, "position", temp);
temp = PyInt_FromLong(tree.address);
DICTADD(t_dict, "address", temp);
return t_dict;
return t_Obj;
}
struct DF_Vegetation