From 0850182872fef788d8cf128f3a5901dca142fa8f Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 7 Apr 2003 00:43:32 +0000 Subject: [PATCH] More VC7 stack trashing fixes, vec3 ops performed on a vec2 (oh my!) --- source/blender/blenkernel/intern/subsurf.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/subsurf.c b/source/blender/blenkernel/intern/subsurf.c index aeae6d3215d..064db5368ea 100644 --- a/source/blender/blenkernel/intern/subsurf.c +++ b/source/blender/blenkernel/intern/subsurf.c @@ -129,10 +129,14 @@ static float *Vec3AddT(float *t, float *a, float *b) { static float *Vec2Add(float *ta, float *b) { ta[0]+= b[0]; ta[1]+= b[1]; - ta[2]+= b[2]; return ta; } +static float *Vec2MulNT(float *t, float *a, float n) { + t[0]= a[0]*n; + t[1]= a[1]*n; + return t; +} static float *Vec3MulNT(float *t, float *a, float n) { t[0]= a[0]*n; t[1]= a[1]*n; @@ -147,6 +151,11 @@ static float *Vec3Add(float *ta, float *b) { return ta; } +static float *Vec2MulN(float *ta, float n) { + ta[0]*= n; + ta[1]*= n; + return ta; +} static float *Vec3MulN(float *ta, float n) { ta[0]*= n; ta[1]*= n; @@ -545,7 +554,7 @@ static void hypermesh_subdivide(HyperMesh *me, HyperMesh *nme) { Vec2CpyI(uvco_mid, 0.0, 0.0); for (j=0; jnverts; j++) Vec2Add(uvco_mid, f->uvco[j]); - Vec3MulN(uvco_mid, (float)(1.0/f->nverts)); + Vec2MulN(uvco_mid, (float)(1.0/f->nverts)); for (j=0; jnverts; last= j, j++) Vec2AvgT(uvco_edge[j], f->uvco[last], f->uvco[j]);