multiple fixes so that the python interface builds with my modifications

develop
simon 2010-04-29 18:24:34 +02:00
parent 860b0a67af
commit 43dff6522a
4 changed files with 20 additions and 30 deletions

@ -49,7 +49,7 @@ namespace DFHack
struct t_creaturetype
{
char rawname[128];
vector <t_creaturecaste> castes;
std::vector <t_creaturecaste> castes;
uint8_t tile_character;
struct
{

@ -25,11 +25,13 @@ distribution.
#ifndef __DFCREATURES__
#define __DFCREATURES__
#include <string>
#include "Python.h"
#include "stdio.h"
#include <vector>
#include "integers.h"
#include "DFTypes.h"
#include "modules/Materials.h"
#include "modules/Creatures.h"
#include "DF_CreatureType.cpp"

@ -28,6 +28,7 @@ distribution.
#include "Python.h"
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
@ -37,8 +38,8 @@ using namespace std;
using namespace DFHack;
#include "modules/Creatures.h"
#include "modules/Materials.h"
#include "modules/Creatures.h"
#define DICTADD(d, name, item) PyDict_SetItemString(d, name, item); Py_DECREF(item)
#define OBJSET(o, name, item) PyObject_SetAttrString(o, name, item); Py_DECREF(item)

@ -27,6 +27,7 @@ distribution.
#include "Python.h"
#include <vector>
#include <string>
#include "integers.h"
using namespace std;
@ -266,11 +267,9 @@ static PyObject* DF_Material_ReadInorganicMaterials(DF_Material* self, PyObject*
{
if(self->mat_Ptr != NULL)
{
std::vector<DFHack::t_matgloss> matVec;
if(self->mat_Ptr->ReadInorganicMaterials(matVec))
if(self->mat_Ptr->ReadInorganicMaterials())
{
return BuildMatglossList(matVec);
return BuildMatglossList(self->mat_Ptr->inorganic);
}
}
@ -281,11 +280,9 @@ static PyObject* DF_Material_ReadOrganicMaterials(DF_Material* self, PyObject* a
{
if(self->mat_Ptr != NULL)
{
std::vector<DFHack::t_matgloss> matVec;
if(self->mat_Ptr->ReadOrganicMaterials(matVec))
if(self->mat_Ptr->ReadOrganicMaterials())
{
return BuildMatglossList(matVec);
return BuildMatglossList(self->mat_Ptr->organic);
}
}
@ -296,11 +293,9 @@ static PyObject* DF_Material_ReadWoodMaterials(DF_Material* self, PyObject* args
{
if(self->mat_Ptr != NULL)
{
std::vector<DFHack::t_matgloss> matVec;
if(self->mat_Ptr->ReadWoodMaterials(matVec))
if(self->mat_Ptr->ReadWoodMaterials())
{
return BuildMatglossList(matVec);
return BuildMatglossList(self->mat_Ptr->tree);
}
}
@ -311,11 +306,9 @@ static PyObject* DF_Material_ReadPlantMaterials(DF_Material* self, PyObject* arg
{
if(self->mat_Ptr != NULL)
{
std::vector<DFHack::t_matgloss> matVec;
if(self->mat_Ptr->ReadPlantMaterials(matVec))
if(self->mat_Ptr->ReadPlantMaterials())
{
return BuildMatglossList(matVec);
return BuildMatglossList(self->mat_Ptr->plant);
}
}
@ -326,11 +319,9 @@ static PyObject* DF_Material_ReadCreatureTypes(DF_Material* self, PyObject* args
{
if(self->mat_Ptr != NULL)
{
std::vector<DFHack::t_matgloss> matVec;
if(self->mat_Ptr->ReadCreatureTypes(matVec))
if(self->mat_Ptr->ReadCreatureTypes())
{
return BuildMatglossList(matVec);
return BuildMatglossList(self->mat_Ptr->race);
}
}
@ -341,11 +332,9 @@ static PyObject* DF_Material_ReadCreatureTypesEx(DF_Material* self, PyObject* ar
{
if(self->mat_Ptr != NULL)
{
std::vector<DFHack::t_creaturetype> creatureVec;
if(self->mat_Ptr->ReadCreatureTypesEx(creatureVec))
if(self->mat_Ptr->ReadCreatureTypesEx())
{
return BuildCreatureTypeExList(creatureVec);
return BuildCreatureTypeExList(self->mat_Ptr->raceEx);
}
}
@ -356,11 +345,9 @@ static PyObject* DF_Material_ReadDescriptorColors(DF_Material* self, PyObject* a
{
if(self->mat_Ptr != NULL)
{
std::vector<DFHack::t_descriptor_color> colorVec;
if(self->mat_Ptr->ReadDescriptorColors(colorVec))
if(self->mat_Ptr->ReadDescriptorColors())
{
return BuildDescriptorColorList(colorVec);
return BuildDescriptorColorList(self->mat_Ptr->color);
}
}