added map coordinate struct and the callback needed to flatten the std::map of coords to features into an array

develop
doomchild 2011-03-14 14:58:37 -05:00
parent d347713860
commit b1ed423f98
2 changed files with 40 additions and 0 deletions

@ -99,6 +99,8 @@ int (*alloc_spattervein_buffer_callback)(t_spattervein**, uint32_t) = NULL;
int (*alloc_grassvein_buffer_callback)(t_grassvein**, uint32_t) = NULL;
int (*alloc_worldconstruction_buffer_callback)(t_worldconstruction**, uint32_t) = NULL;
int (*alloc_featuremap_buffer_callback)(c_featuremap_node**, uint32_t*, uint32_t) = NULL;
//int (*alloc_bodypart_buffer_callback)(t_bodypart**, uint32_t) = NULL;
REG_MACRO(Byte, int8_t**, alloc_byte_buffer_callback)
REG_MACRO(Short, int16_t**, alloc_short_buffer_callback)
@ -153,6 +155,13 @@ UNREG_MACRO(SpatterVein, alloc_spattervein_buffer_callback)
UNREG_MACRO(GrassVein, alloc_grassvein_buffer_callback)
UNREG_MACRO(WorldConstruction, alloc_worldconstruction_buffer_callback)
void RegisterFeatureMapBufferCallback(int (*funcptr)(c_featuremap_node**, uint32_t*, uint32_t))
{
alloc_featuremap_buffer_callback = funcptr;
}
UNREG_MACRO(FeatureMap, alloc_featuremap_buffer_callback)
int DFHack_isWallTerrain(int in)
{
return DFHack::isWallTerrain(in);

@ -219,6 +219,37 @@ HUNREG_MACRO(SpatterVein)
HUNREG_MACRO(GrassVein)
HUNREG_MACRO(WorldConstruction)
struct c_mapcoord
{
union
{
struct
{
uint16_t x;
uint16_t y;
uint32_t z;
};
struct
{
uint16_t x;
uint16_t y;
} dim;
uint64_t comparate;
};
};
struct c_featuremap_node
{
c_mapcoord coordinate;
t_feature* features;
uint32_t feature_length;
};
DFHACK_EXPORT extern int (*alloc_featuremap_buffer_callback)(c_featuremap_node**, uint32_t*, uint32_t);
DFHACK_EXPORT void RegisterFeatureMapBufferCallback(int (*funcptr)(c_featuremap_node**, uint32_t*, uint32_t));
DFHACK_EXPORT int DFHack_isWallTerrain(int in);
DFHACK_EXPORT int DFHack_isFloorTerrain(int in);
DFHACK_EXPORT int DFHack_isRampTerrain(int in);