From f86cb94d369a215d889fef2afeaf5cb05a0a868f Mon Sep 17 00:00:00 2001 From: doomchild Date: Tue, 20 Apr 2010 12:21:52 -0500 Subject: [PATCH] updated type string, tweaked reverse designation build --- dfhack/python/DF_Maps.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dfhack/python/DF_Maps.cpp b/dfhack/python/DF_Maps.cpp index 788130444..e397d9ef7 100644 --- a/dfhack/python/DF_Maps.cpp +++ b/dfhack/python/DF_Maps.cpp @@ -301,7 +301,7 @@ static void ReverseBuildDesignations40d(PyObject* list, DFHack::designations40d& for(int i = 0; i < 16; i++) { - innerList = PyList_GetItem(list, i); + innerList = PyList_GET_ITEM(list, i); for(int j = 0; j < 16; j++) des[i][j].whole = (uint32_t)PyInt_AsLong(PyList_GET_ITEM(innerList, j)); @@ -581,6 +581,8 @@ static PyObject* DF_Map_ReadDesignations(DF_Map* self, PyObject* args) Py_RETURN_NONE; } +static DFHack::designations40d writeDes; + static PyObject* DF_Map_WriteDesignations(DF_Map* self, PyObject* args) { PyObject* desList; @@ -591,11 +593,9 @@ static PyObject* DF_Map_WriteDesignations(DF_Map* self, PyObject* args) if(!PyArg_ParseTuple(args, "IIIO", &x, &y, &z, &desList)) return NULL; - designations40d des; - - ReverseBuildDesignations40d(desList, des); + ReverseBuildDesignations40d(desList, writeDes); - if(self->m_Ptr->WriteDesignations(x, y, z, &des)) + if(self->m_Ptr->WriteDesignations(x, y, z, &writeDes)) Py_RETURN_TRUE; else Py_RETURN_FALSE; @@ -817,7 +817,7 @@ static PyTypeObject DF_Map_type = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ - "pydfhack.Map", /*tp_name*/ + "pydfhack._MapManager", /*tp_name*/ sizeof(DF_Map), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)DF_Map_dealloc, /*tp_dealloc*/ @@ -836,7 +836,7 @@ static PyTypeObject DF_Map_type = 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "pydfhack Map objects", /* tp_doc */ + "pydfhack MapManager object", /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */