From 01dca44a840cb6066adb4845a5e93e0d118f239c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 10 Sep 2011 04:21:58 +0000 Subject: disable navmesh feature when building without the game engine. --- source/blender/editors/object/CMakeLists.txt | 11 ++++++++++- source/blender/editors/object/object_ops.c | 3 +++ source/blender/editors/util/CMakeLists.txt | 7 ++++++- source/blender/modifiers/CMakeLists.txt | 4 ++++ source/blender/modifiers/intern/MOD_navmesh.cpp | 16 +++++++++++++--- 5 files changed, 36 insertions(+), 5 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt index de74a0321c7..58ebb12e345 100644 --- a/source/blender/editors/object/CMakeLists.txt +++ b/source/blender/editors/object/CMakeLists.txt @@ -49,7 +49,6 @@ set(SRC object_hook.c object_lattice.c object_modifier.c - object_navmesh.cpp object_ops.c object_relations.c object_select.c @@ -60,8 +59,18 @@ set(SRC object_intern.h ) +if(WITH_GAMEENGINE) + list(APPEND SRC + object_navmesh.cpp + ) +endif() + if(WITH_PYTHON) add_definitions(-DWITH_PYTHON) endif() +if(WITH_GAMEENGINE) + add_definitions(-DWITH_GAMEENGINE) +endif() + blender_add_lib(bf_editor_object "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 29d536c1dab..5eb17268d19 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -213,11 +213,14 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_bake_image); WM_operatortype_append(OBJECT_OT_drop_named_material); +#ifdef WITH_GAMEENGINE WM_operatortype_append(OBJECT_OT_create_navmesh); WM_operatortype_append(OBJECT_OT_assign_navpolygon); WM_operatortype_append(OBJECT_OT_assign_new_navpolygon); +#endif } + void ED_operatormacros_object(void) { wmOperatorType *ot; diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt index da6e1990622..5e05342f3dc 100644 --- a/source/blender/editors/util/CMakeLists.txt +++ b/source/blender/editors/util/CMakeLists.txt @@ -40,7 +40,6 @@ set(SRC editmode_undo.c numinput.c undo.c - navmesh_conversion.cpp crazyspace.c util_intern.h @@ -90,4 +89,10 @@ set(SRC ../include/UI_view2d.h ) +if(WITH_GAMEENGINE) + list(APPEND SRC + navmesh_conversion.cpp + ) +endif() + blender_add_lib(bf_editor_util "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt index d06ada737ee..bdbc51605ba 100644 --- a/source/blender/modifiers/CMakeLists.txt +++ b/source/blender/modifiers/CMakeLists.txt @@ -119,4 +119,8 @@ if(NOT WITH_MOD_FLUID) add_definitions(-DDISABLE_ELBEEM) endif() +if(WITH_GAMEENGINE) + add_definitions(-DWITH_GAMEENGINE) +endif() + blender_add_lib(bf_modifiers "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/modifiers/intern/MOD_navmesh.cpp b/source/blender/modifiers/intern/MOD_navmesh.cpp index 7a1c2bb6059..bc97023a58b 100644 --- a/source/blender/modifiers/intern/MOD_navmesh.cpp +++ b/source/blender/modifiers/intern/MOD_navmesh.cpp @@ -33,7 +33,10 @@ extern "C"{ #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" + #include "BLI_math.h" +#include "BLI_utildefines.h" + #include "BKE_cdderivedmesh.h" #include "BKE_mesh.h" #include "BKE_modifier.h" @@ -47,13 +50,13 @@ extern "C"{ static void initData(ModifierData *md) { - NavMeshModifierData *nmmd = (NavMeshModifierData*) md; + /* NavMeshModifierData *nmmd = (NavMeshModifierData*) md; */ /* UNUSED */ } static void copyData(ModifierData *md, ModifierData *target) { - NavMeshModifierData *nmmd = (NavMeshModifierData*) md; - NavMeshModifierData *tnmmd = (NavMeshModifierData*) target; + /* NavMeshModifierData *nmmd = (NavMeshModifierData*) md; */ + /* NavMeshModifierData *tnmmd = (NavMeshModifierData*) target; */ //.todo - deep copy } @@ -62,6 +65,8 @@ static void copyData(ModifierData *md, ModifierData *target) static void (*drawFacesSolid_original)(DerivedMesh *dm, float (*partial_redraw_planes)[4], int fast, int (*setMaterial)(int, void *attribs)) = NULL;*/ +#ifdef WITH_GAMEENGINE + static void drawNavMeshColored(DerivedMesh *dm) { int a, glmode; @@ -122,9 +127,11 @@ static void navDM_drawFacesSolid(DerivedMesh *dm, //drawFacesSolid_original(dm, partial_redraw_planes, fast, setMaterial); drawNavMeshColored(dm); } +#endif /* WITH_GAMEENGINE */ static DerivedMesh *createNavMeshForVisualization(NavMeshModifierData *mmd,DerivedMesh *dm) { +#ifdef WITH_GAMEENGINE DerivedMesh *result; int maxFaces = dm->getNumFaces(dm); @@ -194,6 +201,9 @@ static DerivedMesh *createNavMeshForVisualization(NavMeshModifierData *mmd,Deriv delete trisToFacesMap; return result; +#else // WITH_GAMEENGINE + return dm; +#endif // WITH_GAMEENGINE } /* -- cgit v1.2.3