From a8b5c461fea689cbef2cf78f0f5764e396ee162f Mon Sep 17 00:00:00 2001 From: doomchild Date: Tue, 6 Jul 2010 14:07:10 -0500 Subject: [PATCH] added terrain checkers --- library/DFTypes_C.cpp | 34 ++++++++++++++++++++++++++++ library/include/dfhack-c/DFTypes_C.h | 7 ++++++ 2 files changed, 41 insertions(+) diff --git a/library/DFTypes_C.cpp b/library/DFTypes_C.cpp index 6d3f8d789..b8f0a6a9b 100644 --- a/library/DFTypes_C.cpp +++ b/library/DFTypes_C.cpp @@ -67,6 +67,40 @@ int (*alloc_empty_creaturetype_callback)(c_creaturetype*) = NULL; int (*alloc_creaturetype_callback)(c_creaturetype*, const char*, uint32_t, uint32_t, uint8_t, uint16_t, uint16_t, uint16_t) = NULL; int (*alloc_creaturetype_buffer_callback)(c_creaturetype*, uint32_t) = NULL; +int (*alloc_vein_buffer_callback)(t_vein*, uint32_t) = NULL; +int (*alloc_frozenliquidvein_buffer_callback)(t_frozenliquidvein*, uint32_t) = NULL; +int (*alloc_spattervein_buffer_callback)(t_spattervein*, uint32_t) = NULL; + +int DFHack_isWallTerrain(int in) +{ + return DFHack::isWallTerrain(in); +} + +int DFHack_isFloorTerrain(int in) +{ + return DFHack::isFloorTerrain(in); +} + +int DFHack_isRampTerrain(int in) +{ + return DFHack::isRampTerrain(in); +} + +int DFHack_isStairTerrain(int in) +{ + return DFHack::isStairTerrain(in); +} + +int DFHack_isOpenTerrain(int in) +{ + return DFHack::isOpenTerrain(in); +} + +int DFHack_getVegetationType(int in) +{ + return DFHack::getVegetationType(in); +} + #ifdef __cplusplus } #endif diff --git a/library/include/dfhack-c/DFTypes_C.h b/library/include/dfhack-c/DFTypes_C.h index 8346dc5ff..fbd883ead 100644 --- a/library/include/dfhack-c/DFTypes_C.h +++ b/library/include/dfhack-c/DFTypes_C.h @@ -105,6 +105,13 @@ DFHACK_EXPORT extern int (*alloc_vein_buffer_callback)(t_vein*, uint32_t); DFHACK_EXPORT extern int (*alloc_frozenliquidvein_buffer_callback)(t_frozenliquidvein*, uint32_t); DFHACK_EXPORT extern int (*alloc_spattervein_buffer_callback)(t_spattervein*, uint32_t); +DFHACK_EXPORT extern int DFHack_isWallTerrain(int in); +DFHACK_EXPORT extern int DFHack_isFloorTerrain(int in); +DFHACK_EXPORT extern int DFHack_isRampTerrain(int in); +DFHACK_EXPORT extern int DFHack_isStairTerrain(int in); +DFHACK_EXPORT extern int DFHack_isOpenTerrain(int in); +DFHACK_EXPORT extern int DFHack_getVegetationType(int in); + #ifdef __cplusplus } #endif