diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-13 13:21:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-13 13:37:18 +0300 |
commit | f8a499b596b8af46201b86a30c9807ca54363e25 (patch) | |
tree | 8ce53c7fb9c598deda0141f3eecf7d316b8c24b1 /source/blender/blenkernel/intern/subdiv.c | |
parent | 33fbc4fbea14a17d71eacf2c152d51518737df35 (diff) |
OpenSubdiv: Add stub implementation of C-API
C-API is way smaller than the rest of the code which uses it.
So better to conditionally compile stub implementation than
to keep adding ifdef everywhere.
Diffstat (limited to 'source/blender/blenkernel/intern/subdiv.c')
-rw-r--r-- | source/blender/blenkernel/intern/subdiv.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/source/blender/blenkernel/intern/subdiv.c b/source/blender/blenkernel/intern/subdiv.c index bae5491c079..207fdf43c55 100644 --- a/source/blender/blenkernel/intern/subdiv.c +++ b/source/blender/blenkernel/intern/subdiv.c @@ -37,17 +37,14 @@ #include "subdiv_converter.h" -#ifdef WITH_OPENSUBDIV -# include "opensubdiv_capi.h" -# include "opensubdiv_converter_capi.h" -# include "opensubdiv_evaluator_capi.h" -# include "opensubdiv_topology_refiner_capi.h" -#endif +#include "opensubdiv_capi.h" +#include "opensubdiv_converter_capi.h" +#include "opensubdiv_evaluator_capi.h" +#include "opensubdiv_topology_refiner_capi.h" Subdiv *BKE_subdiv_new_from_converter(const SubdivSettings *settings, struct OpenSubdiv_Converter *converter) { -#ifdef WITH_OPENSUBDIV SubdivStats stats; BKE_subdiv_stats_init(&stats); BKE_subdiv_stats_begin(&stats, SUBDIV_STATS_TOPOLOGY_REFINER_CREATION_TIME); @@ -74,16 +71,11 @@ Subdiv *BKE_subdiv_new_from_converter(const SubdivSettings *settings, BKE_subdiv_stats_end(&stats, SUBDIV_STATS_TOPOLOGY_REFINER_CREATION_TIME); subdiv->stats = stats; return subdiv; -#else - UNUSED_VARS(settings, converter); - return NULL; -#endif } Subdiv *BKE_subdiv_new_from_mesh(const SubdivSettings *settings, struct Mesh *mesh) { -#ifdef WITH_OPENSUBDIV if (mesh->totvert == 0) { return NULL; } @@ -92,15 +84,10 @@ Subdiv *BKE_subdiv_new_from_mesh(const SubdivSettings *settings, Subdiv *subdiv = BKE_subdiv_new_from_converter(settings, &converter); BKE_subdiv_converter_free(&converter); return subdiv; -#else - UNUSED_VARS(settings, mesh); - return NULL; -#endif } void BKE_subdiv_free(Subdiv *subdiv) { -#ifdef WITH_OPENSUBDIV if (subdiv->evaluator != NULL) { openSubdiv_deleteEvaluator(subdiv->evaluator); } @@ -108,7 +95,4 @@ void BKE_subdiv_free(Subdiv *subdiv) openSubdiv_deleteTopologyRefiner(subdiv->topology_refiner); } MEM_freeN(subdiv); -#else - UNUSED_VARS(subdiv); -#endif } |