Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2011-09-11 18:13:04 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2011-09-11 18:13:04 +0400
commitb988a2abf815d74aba7bd9bf910b712735ea8f53 (patch)
tree0b2bf75ea63641014a3441c09d47d9911201d2c7 /source/blender/modifiers
parent3d3f6b1ddc655a070c20e41abec2e7850fd266e6 (diff)
Recast: fix bad level calls, Recast compiled out if BGE not enabled. SCons updated but not tested.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/CMakeLists.txt1
-rw-r--r--source/blender/modifiers/SConscript7
-rw-r--r--source/blender/modifiers/intern/MOD_navmesh.cpp21
3 files changed, 23 insertions, 6 deletions
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index 083ad052a58..d8344a9e19b 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -122,7 +122,6 @@ if(WITH_GAMEENGINE)
list(APPEND INC
../gpu
../../../extern/recastnavigation/Recast/Include
- ../editors/include # XXX - BAD LEVEL CALL, REMOVE BEFORE RELEASE
)
endif()
diff --git a/source/blender/modifiers/SConscript b/source/blender/modifiers/SConscript
index f90e637d151..da37539e950 100644
--- a/source/blender/modifiers/SConscript
+++ b/source/blender/modifiers/SConscript
@@ -7,8 +7,7 @@ incs = '. ./intern'
incs += ' #/intern/guardedalloc #/intern/decimation/extern #/intern/bsp/extern #/intern/elbeem/extern #/extern/glew/include'
incs += ' ../render/extern/include ../blenloader'
incs += ' ../include ../blenlib ../makesdna ../makesrna ../blenkernel ../blenkernel/intern'
-incs += ' ../editors/include ../gpu'
-incs += ' #extern/recastnavigation/Recast/Include'
+incs += ' ../gpu'
incs += ' ' + env['BF_ZLIB_INC']
@@ -21,6 +20,10 @@ defs += ['WITH_MOD_DECIMATE']
if env['BF_NO_ELBEEM']:
defs.append('DISABLE_ELBEEM')
+if env['WITH_BF_GAMEENGINE']:
+ incs += ' #/extern/recastnavigation/Recast/Include'
+ defs.append('WITH_GAMEENGINE')
+
env.BlenderLib ( libname = 'bf_modifiers', sources = sources,
includes = Split(incs), defines=defs,
libtype=['core','player'], priority = [80, 40] )
diff --git a/source/blender/modifiers/intern/MOD_navmesh.cpp b/source/blender/modifiers/intern/MOD_navmesh.cpp
index d32281c12b6..927085033fc 100644
--- a/source/blender/modifiers/intern/MOD_navmesh.cpp
+++ b/source/blender/modifiers/intern/MOD_navmesh.cpp
@@ -34,11 +34,10 @@
extern "C"{
#ifdef WITH_GAMEENGINE
-# include "ED_navmesh_conversion.h"
-# include "BIF_gl.h"
+# include "BKE_navmesh_conversion.h"
+# include "GL/glew.h"
# include "GPU_buffers.h"
# include "GPU_draw.h"
-# include "UI_resources.h"
#endif
#include "DNA_mesh_types.h"
@@ -54,6 +53,22 @@ extern "C"{
#include "BKE_customdata.h"
#include "MEM_guardedalloc.h"
+inline int bit(int a, int b)
+{
+ return (a & (1 << b)) >> b;
+}
+
+inline void intToCol(int i, float* col)
+{
+ int r = bit(i, 0) + bit(i, 3) * 2 + 1;
+ int g = bit(i, 1) + bit(i, 4) * 2 + 1;
+ int b = bit(i, 2) + bit(i, 5) * 2 + 1;
+ col[0] = 1 - r*63.0f/255.0f;
+ col[1] = 1 - g*63.0f/255.0f;
+ col[2] = 1 - b*63.0f/255.0f;
+}
+
+
static void initData(ModifierData *md)
{
/* NavMeshModifierData *nmmd = (NavMeshModifierData*) md; */ /* UNUSED */