wrapped ReadGlobalFeatures

develop
doomchild 2010-08-26 10:28:54 -05:00
parent b78b0ad2e6
commit cfa39dde7f
2 changed files with 33 additions and 0 deletions

@ -36,6 +36,8 @@ extern "C" {
DFHACK_EXPORT int Maps_Start(DFHackObject* maps);
DFHACK_EXPORT int Maps_Finish(DFHackObject* maps);
DFHACK_EXPORT t_feature* Maps_ReadGlobalFeatures(DFHackObject* maps);
DFHACK_EXPORT void Maps_getSize(DFHackObject* maps, uint32_t* x, uint32_t* y, uint32_t* z);
DFHACK_EXPORT int Maps_isValidBlock(DFHackObject* maps, uint32_t x, uint32_t y, uint32_t z);

@ -54,6 +54,37 @@ int Maps_Finish(DFHackObject* maps)
return -1;
}
t_feature* Maps_ReadGlobalFeatures(DFHackObject* maps)
{
if(maps != NULL)
{
std::vector<t_feature> featureVec;
if(((DFHack::Maps*)maps)->ReadGlobalFeatures(featureVec))
{
if(featureVec.size() <= 0)
return NULL;
t_feature* buf;
(*alloc_t_feature_buffer_callback)(buf, featureVec.size());
if(buf != NULL)
{
copy(featureVec.begin(), featureVec.end(), buf);
return buf;
}
else
return NULL;
}
else
return NULL;
}
return NULL;
}
void Maps_getSize(DFHackObject* maps, uint32_t* x, uint32_t* y, uint32_t* z)
{
if(maps != NULL)