diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2011-09-11 18:13:04 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2011-09-11 18:13:04 +0400 |
commit | b988a2abf815d74aba7bd9bf910b712735ea8f53 (patch) | |
tree | 0b2bf75ea63641014a3441c09d47d9911201d2c7 /source/blender/modifiers/intern/MOD_navmesh.cpp | |
parent | 3d3f6b1ddc655a070c20e41abec2e7850fd266e6 (diff) |
Recast: fix bad level calls, Recast compiled out if BGE not enabled. SCons updated but not tested.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_navmesh.cpp')
-rw-r--r-- | source/blender/modifiers/intern/MOD_navmesh.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
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 */ |