[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40405] trunk/blender: Fix for recent commit:
Sergey Sharybin
g.ulairi at gmail.com
Tue Sep 20 19:06:18 CEST 2011
Revision: 40405
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40405
Author: nazgul
Date: 2011-09-20 17:06:17 +0000 (Tue, 20 Sep 2011)
Log Message:
-----------
Fix for recent commit:
- Some declarations after statement left.
- Do not use static inline functions in MOD_navmesh. It produces errors
with msvc and not sure it's actually helps -- optimizer should
make it inlined itself.
Modified Paths:
--------------
trunk/blender/extern/recastnavigation/SConscript
trunk/blender/source/blender/blenkernel/intern/navmesh_conversion.c
trunk/blender/source/blender/modifiers/intern/MOD_navmesh.c
Modified: trunk/blender/extern/recastnavigation/SConscript
===================================================================
--- trunk/blender/extern/recastnavigation/SConscript 2011-09-20 16:24:50 UTC (rev 40404)
+++ trunk/blender/extern/recastnavigation/SConscript 2011-09-20 17:06:17 UTC (rev 40405)
@@ -3,6 +3,7 @@
Import('env')
sources = env.Glob('Recast/Source/*.cpp') + env.Glob('Detour/Source/*.cpp')
+sources += ['recast-capi.cpp']
incs = 'Recast/Include Detour/Include'
Modified: trunk/blender/source/blender/blenkernel/intern/navmesh_conversion.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/navmesh_conversion.c 2011-09-20 16:24:50 UTC (rev 40404)
+++ trunk/blender/source/blender/blenkernel/intern/navmesh_conversion.c 2011-09-20 17:06:17 UTC (rev 40405)
@@ -83,10 +83,14 @@
float distPointToSegmentSq(const float* point, const float* a, const float* b)
{
float abx[3], dx[3];
+ float d, t;
+
sub_v3_v3v3(abx, b,a);
sub_v3_v3v3(dx, point,a);
- float d = abx[0]*abx[0]+abx[2]*abx[2];
- float t = abx[0]*dx[0]+abx[2]*dx[2];
+
+ d = abx[0]*abx[0]+abx[2]*abx[2];
+ t = abx[0]*dx[0]+abx[2]*dx[2];
+
if (d > 0)
t /= d;
if (t < 0)
@@ -95,6 +99,7 @@
t = 1;
dx[0] = a[0] + t*abx[0] - point[0];
dx[2] = a[2] + t*abx[2] - point[2];
+
return dx[0]*dx[0] + dx[2]*dx[2];
}
@@ -107,6 +112,8 @@
int *trisToFacesMap;
float *verts;
unsigned short *tris, *tri;
+ int nfaces;
+ MFace *faces;
nverts = dm->getNumVerts(dm);
if (nverts>=0xffff)
@@ -124,8 +131,8 @@
}
//calculate number of tris
- int nfaces = dm->getNumFaces(dm);
- MFace *faces = dm->getFaceArray(dm);
+ nfaces = dm->getNumFaces(dm);
+ faces = dm->getFaceArray(dm);
ntris = nfaces;
for (fi=0; fi<nfaces; fi++)
{
@@ -226,8 +233,9 @@
{
if (nv==capacity)
{
+ unsigned short* newPolyBig;
capacity += vertsPerPoly;
- unsigned short* newPolyBig = MEM_callocN(sizeof(unsigned short)*capacity, "buildPolygonsByDetailedMeshes newPolyBig");
+ newPolyBig = MEM_callocN(sizeof(unsigned short)*capacity, "buildPolygonsByDetailedMeshes newPolyBig");
memset(newPolyBig, 0xff, sizeof(unsigned short)*capacity);
memcpy(newPolyBig, newPoly, sizeof(unsigned short)*nv);
MEM_freeN(newPoly);
Modified: trunk/blender/source/blender/modifiers/intern/MOD_navmesh.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_navmesh.c 2011-09-20 16:24:50 UTC (rev 40404)
+++ trunk/blender/source/blender/modifiers/intern/MOD_navmesh.c 2011-09-20 17:06:17 UTC (rev 40405)
@@ -48,12 +48,12 @@
#include "BKE_customdata.h"
#include "MEM_guardedalloc.h"
-static inline int bit(int a, int b)
+static int bit(int a, int b)
{
return (a & (1 << b)) >> b;
}
-static inline void intToCol(int i, float* col)
+static 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;
More information about the Bf-blender-cvs
mailing list