disable navmesh feature when building without the game engine.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 10 Sep 2011 04:21:58 +0000 (04:21 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 10 Sep 2011 04:21:58 +0000 (04:21 +0000)
extern/CMakeLists.txt
source/blender/editors/object/CMakeLists.txt
source/blender/editors/object/object_ops.c
source/blender/editors/util/CMakeLists.txt
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/intern/MOD_navmesh.cpp

index 266ac6d9f0d554b2f6957ff03464b030efbd739e..0386b3d71d8551337c5f8310792233876cbdb829 100644 (file)
@@ -43,10 +43,9 @@ if(WITH_BUILTIN_GLEW)
        add_subdirectory(glew)
 endif()
 
-## TODO MAKE GAME ENGINE ONLY
-# if(WITH_GAMEENGINE)
+if(WITH_GAMEENGINE)
    add_subdirectory(recastnavigation)
-endif()
+endif()
 
 if(WITH_IMAGE_OPENJPEG AND (NOT UNIX OR APPLE))
        add_subdirectory(libopenjpeg)
index de74a0321c78955d0ee15a941c955a89895ac9c2..58ebb12e3450f88c3011fa44325b12069e4e75d0 100644 (file)
@@ -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}")
index 29d536c1dab3c2793038ca24525e61b2988dfa2b..5eb17268d195ed9e15baa01f8e3fc9fe96663d5f 100644 (file)
@@ -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;
index da6e19906223b6f21e4873fb6e0d6b3acec4a338..5e05342f3dc8a263ddc7dd7a7aefe82c976619ea 100644 (file)
@@ -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}")
index d06ada737eeca9a10022961db76f8b2e39d53871..bdbc51605ba9e5b08f5331d38b9c12a88a219866 100644 (file)
@@ -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}")
index 7a1c2bb6059c73a653373f8812e05eed8fc009f8..bc97023a58b8bb69354ae28eafb7053b57c5fc59 100644 (file)
@@ -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
 }
 
 /*