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:
authorCampbell Barton <ideasman42@gmail.com>2011-09-16 10:56:50 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-16 10:56:50 +0400
commit41fa4565062ede49913d5a39104cfd86eb3b305d (patch)
tree88a9f77820f5990646b5d15c0832cc7d86debf4e /source/blender/render
parent0abe1911d57b4d4a806a5de6f8cdf4f421abb7cf (diff)
replace macros with math lib functions
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/raytrace/rayobject_octree.cpp2
-rw-r--r--source/blender/render/intern/source/convertblender.c4
-rw-r--r--source/blender/render/intern/source/rendercore.c12
-rw-r--r--source/blender/render/intern/source/zbuf.c10
4 files changed, 12 insertions, 16 deletions
diff --git a/source/blender/render/intern/raytrace/rayobject_octree.cpp b/source/blender/render/intern/raytrace/rayobject_octree.cpp
index e35fcbc2df7..5fa0b836f4f 100644
--- a/source/blender/render/intern/raytrace/rayobject_octree.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_octree.cpp
@@ -264,7 +264,7 @@ static int face_in_node(RayFace *face, short x, short y, short z, float rtf[][3]
return 0;
}
-static void ocwrite(Octree *oc, RayFace *face, int quad, short x, short y, short z, float rtf[][3])
+static void ocwrite(Octree *oc, RayFace *face, int quad, short x, short y, short z, float rtf[4][3])
{
Branch *br;
Node *no;
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index c323760296b..934894f63b6 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -1488,8 +1488,8 @@ static void particle_normal_ren(short ren_as, ParticleSettings *part, Render *re
if(part->draw & PART_DRAW_VEL_LENGTH)
mul_v3_fl(vel, len_v3(state->vel));
- VECADDFAC(loc0, loc, vel, -part->draw_line[0]);
- VECADDFAC(loc1, loc, vel, part->draw_line[1]);
+ madd_v3_v3v3fl(loc0, loc, vel, -part->draw_line[0]);
+ madd_v3_v3v3fl(loc1, loc, vel, part->draw_line[1]);
particle_curve(re, obr, dm, ma, sd, loc0, loc1, seed, pa_co);
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 16bbe1ca5c2..59a505a3195 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -2234,21 +2234,17 @@ static int bake_intersect_tree(RayObject* raytree, Isect* isect, float *start, f
maxdist= R.r.bake_maxdist;
else
maxdist= RE_RAYTRACE_MAXDIST + R.r.bake_biasdist;
-
+
/* 'dir' is always normalized */
- VECADDFAC(isect->start, start, dir, -R.r.bake_biasdist);
+ madd_v3_v3v3fl(isect->start, start, dir, -R.r.bake_biasdist);
- isect->dir[0] = dir[0]*sign;
- isect->dir[1] = dir[1]*sign;
- isect->dir[2] = dir[2]*sign;
+ mul_v3_v3fl(isect->dir, dir, sign);
isect->dist = maxdist;
hit = RE_rayobject_raycast(raytree, isect);
if(hit) {
- hitco[0] = isect->start[0] + isect->dist*isect->dir[0];
- hitco[1] = isect->start[1] + isect->dist*isect->dir[1];
- hitco[2] = isect->start[2] + isect->dist*isect->dir[2];
+ madd_v3_v3v3fl(hitco, isect->start, isect->dir, isect->dist);
*dist= isect->dist;
}
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index b8fbd5c44f7..ac56304bdcb 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -843,7 +843,7 @@ static void zbufline_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr), flo
}
-static int clipline(float *v1, float *v2) /* return 0: do not draw */
+static int clipline(float v1[4], float v2[4]) /* return 0: do not draw */
{
float dz,dw, u1=0.0, u2=1.0;
float dx, dy, v13;
@@ -893,7 +893,7 @@ static int clipline(float *v1, float *v2) /* return 0: do not draw */
return 0;
}
-void hoco_to_zco(ZSpan *zspan, float *zco, float *hoco)
+void hoco_to_zco(ZSpan *zspan, float zco[3], const float hoco[4])
{
float div;
@@ -998,7 +998,7 @@ void zbufclipwire(ZSpan *zspan, int obi, int zvlnr, int ec, float *ho1, float *h
}
-void zbufsinglewire(ZSpan *zspan, int obi, int zvlnr, float *ho1, float *ho2)
+void zbufsinglewire(ZSpan *zspan, int obi, int zvlnr, const float ho1[4], const float ho2[4])
{
float f1[4], f2[4];
int c1, c2;
@@ -1008,8 +1008,8 @@ void zbufsinglewire(ZSpan *zspan, int obi, int zvlnr, float *ho1, float *ho2)
if(c1 | c2) { /* not in the middle */
if(!(c1 & c2)) { /* not out completely */
- QUATCOPY(f1, ho1);
- QUATCOPY(f2, ho2);
+ copy_v4_v4(f1, ho1);
+ copy_v4_v4(f2, ho2);
if(clipline(f1, f2)) {
hoco_to_zco(zspan, f1, f1);