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-11-07 05:38:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-07 05:38:32 +0400
commit96d73bfdcfd74bfccd58bf02ae25b64577fce904 (patch)
tree76f1423cdb1fe3079bd6b17c071c3c4a496c6550 /source/blender/render/intern
parent85540d5aa7abb487e546b5483fffeef2e6075af5 (diff)
replace VECCOPY with copy_v3_v3, same for 2d copy, also added vec copy functions for int & char.
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r--source/blender/render/intern/include/rendercore.h1
-rw-r--r--source/blender/render/intern/source/envmap.c2
-rw-r--r--source/blender/render/intern/source/imagetexture.c2
-rw-r--r--source/blender/render/intern/source/pixelshading.c10
-rw-r--r--source/blender/render/intern/source/pointdensity.c12
-rw-r--r--source/blender/render/intern/source/rendercore.c51
-rw-r--r--source/blender/render/intern/source/shadbuf.c8
-rw-r--r--source/blender/render/intern/source/shadeinput.c4
-rw-r--r--source/blender/render/intern/source/strand.c9
-rw-r--r--source/blender/render/intern/source/volume_precache.c2
-rw-r--r--source/blender/render/intern/source/voxeldata.c6
11 files changed, 51 insertions, 56 deletions
diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h
index 5a544c46255..08f73ccbe0d 100644
--- a/source/blender/render/intern/include/rendercore.h
+++ b/source/blender/render/intern/include/rendercore.h
@@ -42,7 +42,6 @@
/* vector defines */
#define CROSS(dest, a, b) { dest[0]= a[1] * b[2] - a[2] * b[1]; dest[1]= a[2] * b[0] - a[0] * b[2]; dest[2]= a[0] * b[1] - a[1] * b[0]; }
-#define VECMUL(dest, f) { dest[0]*= f; dest[1]*= f; dest[2]*= f; }
struct HaloRen;
struct ShadeInput;
diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c
index 2f20c328405..6ea62828601 100644
--- a/source/blender/render/intern/source/envmap.c
+++ b/source/blender/render/intern/source/envmap.c
@@ -704,7 +704,7 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
}
/* rotate to envmap space, if object is set */
- VECCOPY(vec, texvec);
+ copy_v3_v3(vec, texvec);
if(env->object) mul_m3_v3(env->obimat, vec);
else mul_mat3_m4_v3(R.viewinv, vec);
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 1887f22198d..d1f7059416d 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -92,7 +92,7 @@ static void ibuf_get_color(float *col, struct ImBuf *ibuf, int x, int y)
}
else if(ibuf->channels==3) {
float *fp= ibuf->rect_float + 3*ofs;
- VECCOPY(col, fp);
+ copy_v3_v3(col, fp);
col[3]= 1.0f;
}
else {
diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c
index dfd10687a33..36709408496 100644
--- a/source/blender/render/intern/source/pixelshading.c
+++ b/source/blender/render/intern/source/pixelshading.c
@@ -84,7 +84,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
ir= ig= ib= 0.0;
- VECCOPY(rco, har->co);
+ copy_v3_v3(rco, har->co);
dco[0]=dco[1]=dco[2]= 1.0f/har->rad;
vn= har->no;
@@ -97,7 +97,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
/* lampdist cacluation */
if(lar->type==LA_SUN || lar->type==LA_HEMI) {
- VECCOPY(lv, lar->vec);
+ copy_v3_v3(lv, lar->vec);
lampdist= 1.0;
}
else {
@@ -146,7 +146,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
memset(&shi, 0, sizeof(ShadeInput));
/* end warning! - Campbell */
- VECCOPY(shi.co, rco);
+ copy_v3_v3(shi.co, rco);
shi.osatex= 0;
do_lamp_tex(lar, lv, &shi, lacol, LA_TEXTURE);
}
@@ -158,7 +158,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
float x, lvrot[3];
/* rotate view to lampspace */
- VECCOPY(lvrot, lv);
+ copy_v3_v3(lvrot, lv);
mul_m3_v3(lar->imat, lvrot);
x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2]));
@@ -610,7 +610,7 @@ void shadeSkyPixel(float collector[4], float fx, float fy, short thread)
if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) {
/* 1. solid color */
- VECCOPY(collector, &R.wrld.horr);
+ copy_v3_v3(collector, &R.wrld.horr);
collector[3] = 0.0f;
}
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index 36ded5c10d2..c3a4ca9bf7d 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -153,7 +153,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa
state.time = cfra;
if(psys_get_particle_state(&sim, i, &state, 0)) {
- VECCOPY(partco, state.co);
+ copy_v3_v3(partco, state.co);
if (pd->psys_cache_space == TEX_PD_OBJECTSPACE)
mul_m4_v3(ob->imat, partco);
@@ -217,7 +217,7 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, Object *ob)
for(i=0; i < pd->totpoints; i++, mvert++) {
float co[3];
- VECCOPY(co, mvert->co);
+ copy_v3_v3(co, mvert->co);
switch(pd->ob_cache_space) {
case TEX_PD_OBJECTSPACE:
@@ -423,7 +423,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
(pd->flag&TEX_PD_FALLOFF_CURVE ? pd->falloff_curve : NULL), pd->falloff_speed_scale*0.001f);
noise_fac = pd->noise_fac * 0.5f; /* better default */
- VECCOPY(co, texvec);
+ copy_v3_v3(co, texvec);
if (point_data_used(pd)) {
/* does a BVH lookup to find accumulated density and additional point data *
@@ -480,7 +480,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
if (pd->coba) {
if (do_colorband(pd->coba, age, col)) {
texres->talpha= 1;
- VECCOPY(&texres->tr, col);
+ copy_v3_v3(&texres->tr, col);
texres->tin *= col[3];
texres->ta = texres->tin;
}
@@ -493,7 +493,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
if (pd->coba) {
if (do_colorband(pd->coba, speed, col)) {
texres->talpha= 1;
- VECCOPY(&texres->tr, col);
+ copy_v3_v3(&texres->tr, col);
texres->tin *= col[3];
texres->ta = texres->tin;
}
@@ -503,7 +503,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
case TEX_PD_COLOR_PARTVEL:
texres->talpha= 1;
mul_v3_fl(vec, pd->speed_scale);
- VECCOPY(&texres->tr, vec);
+ copy_v3_v3(&texres->tr, vec);
texres->ta = texres->tin;
break;
case TEX_PD_COLOR_CONSTANT:
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 48134c46c61..456702e0827 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -768,18 +768,17 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
continue;
}
- VECCOPY(tmp_rgb, rgbrect);
+ copy_v3_v3(tmp_rgb, rgbrect);
if(rgbrect[3]!=1.0f) { /* de-premul */
- float div= 1.0f/rgbrect[3];
- VECMUL(tmp_rgb, div);
+ mul_v3_fl(tmp_rgb, 1.0f/rgbrect[3]);
}
shadeAtmPixel(lar->sunsky, tmp_rgb, x, y, *zrect);
if(rgbrect[3]!=1.0f) { /* premul */
- VECMUL(tmp_rgb, rgbrect[3]);
+ mul_v3_fl(tmp_rgb, rgbrect[3]);
}
if(done==0) {
- VECCOPY(rgb, tmp_rgb);
+ copy_v3_v3(rgb, tmp_rgb);
done = 1;
}
else{
@@ -793,7 +792,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
/* if at least for one sun lamp aerial perspective was applied*/
if(done) {
- VECCOPY(rgbrect, rgb);
+ copy_v3_v3(rgbrect, rgb);
}
}
}
@@ -1533,13 +1532,13 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
then clamp to avoid a too large contribution from a single pixel */
shi->osatex= 1;
- VECCOPY(nor, shi->facenor);
+ copy_v3_v3(nor, shi->facenor);
calc_view_vector(shi->facenor, sx, sy);
normalize_v3(shi->facenor);
shade_input_set_viewco(shi, x, y, sx, sy, z);
orthoarea= len_v3(shi->dxco)*len_v3(shi->dyco);
- VECCOPY(shi->facenor, nor);
+ copy_v3_v3(shi->facenor, nor);
shade_input_set_viewco(shi, x, y, sx, sy, z);
*area= len_v3(shi->dxco)*len_v3(shi->dyco);
*area= MIN2(*area, 2.0f*orthoarea);
@@ -1572,8 +1571,8 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
shade_samples_do_AO(ssamp);
shade_material_loop(shi, &shr);
- VECCOPY(co, shi->co);
- VECCOPY(color, shr.combined);
+ copy_v3_v3(co, shi->co);
+ copy_v3_v3(color, shr.combined);
/* texture blending */
/* texfac= shi->mat->sss_texfac; */ /* UNUSED */
@@ -1711,7 +1710,7 @@ void zbufshade_sss_tile(RenderPart *pa)
totpoint++;
- VECADD(fcol, fcol, color);
+ add_v3_v3(fcol, color);
fcol[3]= 1.0f;
}
@@ -1730,7 +1729,7 @@ void zbufshade_sss_tile(RenderPart *pa)
shade_sample_sss(&ssamp, mat, obi, vlr, quad, x, y, *rz,
co[totpoint], color[totpoint], &area[totpoint]);
- VECADD(fcol, fcol, color[totpoint]);
+ add_v3_v3(fcol, color[totpoint]);
fcol[3]= 1.0f;
totpoint++;
}
@@ -1753,7 +1752,7 @@ void zbufshade_sss_tile(RenderPart *pa)
/* to indicate this is a back sample */
area[totpoint]= -area[totpoint];
- VECADD(fcol, fcol, color[totpoint]);
+ add_v3_v3(fcol, color[totpoint]);
fcol[3]= 1.0f;
totpoint++;
}
@@ -2068,7 +2067,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
if(bs->type==RE_BAKE_NORMALS) {
float nor[3];
- VECCOPY(nor, shi->vn);
+ copy_v3_v3(nor, shi->vn);
if(R.r.bake_normal_space == R_BAKE_SPACE_CAMERA);
else if(R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) {
@@ -2076,16 +2075,16 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
/* bitangent */
if(tvn && ttang) {
- VECCOPY(mat[0], ttang);
+ copy_v3_v3(mat[0], ttang);
cross_v3_v3v3(mat[1], tvn, ttang);
mul_v3_fl(mat[1], ttang[3]);
- VECCOPY(mat[2], tvn);
+ copy_v3_v3(mat[2], tvn);
}
else {
- VECCOPY(mat[0], shi->nmaptang);
+ copy_v3_v3(mat[0], shi->nmaptang);
cross_v3_v3v3(mat[1], shi->nmapnorm, shi->nmaptang);
mul_v3_fl(mat[1], shi->nmaptang[3]);
- VECCOPY(mat[2], shi->nmapnorm);
+ copy_v3_v3(mat[2], shi->nmapnorm);
}
invert_m3_m3(imat, mat);
@@ -2115,7 +2114,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
shr.alpha = shi->alpha;
}
else if(bs->type==RE_BAKE_SHADOW) {
- VECCOPY(shr.combined, shr.shad);
+ copy_v3_v3(shr.combined, shr.shad);
shr.alpha = shi->alpha;
}
else if(bs->type==RE_BAKE_SPEC_COLOR) {
@@ -2158,7 +2157,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
if(bs->rect_float) {
float *col= bs->rect_float + 4*(bs->rectx*y + x);
- VECCOPY(col, shr.combined);
+ copy_v3_v3(col, shr.combined);
if (bs->type==RE_BAKE_ALL || bs->type==RE_BAKE_TEXTURE) {
col[3]= shr.alpha;
} else {
@@ -2336,15 +2335,15 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
if(obi->flag & R_TRANSFORMED)
mul_m4_v3(obi->mat, shi->co);
- VECCOPY(shi->dxco, bs->dxco);
- VECCOPY(shi->dyco, bs->dyco);
+ copy_v3_v3(shi->dxco, bs->dxco);
+ copy_v3_v3(shi->dyco, bs->dyco);
quad= bs->quad;
bake_set_shade_input(obi, vlr, shi, quad, 0, x, y, u, v);
if(bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT) {
shade_input_set_shade_texco(shi);
- VECCOPY(tvn, shi->nmapnorm);
+ copy_v3_v3(tvn, shi->nmapnorm);
copy_v4_v4(ttang, shi->nmaptang);
}
@@ -2359,7 +2358,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
memset(&minisec, 0, sizeof(minisec));
minco[0]= minco[1]= minco[2]= 0.0f;
- VECCOPY(bs->dir, shi->vn);
+ copy_v3_v3(bs->dir, shi->vn);
for(sign=-1; sign<=1; sign+=2) {
memset(&isec, 0, sizeof(isec));
@@ -2375,7 +2374,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
if(!hit || len_v3v3(shi->co, co) < len_v3v3(shi->co, minco)) {
minisec= isec;
mindist= dist;
- VECCOPY(minco, co);
+ copy_v3_v3(minco, co);
hit= 1;
dir = sign;
}
@@ -2395,7 +2394,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
obi= (ObjectInstanceRen*)minisec.hit.ob;
vlr= (VlakRen*)minisec.hit.face;
quad= (minisec.isect == 2);
- VECCOPY(shi->co, minco);
+ copy_v3_v3(shi->co, minco);
u= -minisec.u;
v= -minisec.v;
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index 274fa4469e0..f3eb2234778 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -672,7 +672,7 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
else ver++;
if(clipflag[a]) {
- VECCOPY(vec, ver->co);
+ copy_v3_v3(vec, ver->co);
mul_m4_v3(obviewmat, vec);
/* Z on visible side of lamp space */
if(vec[2] < 0.0f) {
@@ -2063,7 +2063,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v
float dface, fac, siz;
RE_vlakren_get_normal(&R, obi, vlr, nor);
- VECCOPY(v1, vlr->v1->co);
+ copy_v3_v3(v1, vlr->v1->co);
if(obi->flag & R_TRANSFORMED)
mul_m4_v3(obi->mat, v1);
@@ -2463,7 +2463,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
samp->facenr= apn->p[a] & ~RE_QUAD_OFFS;
samp->shadfac= &apn->shadfac[a];
- VECCOPY(samp->zco, zco);
+ copy_v3_v3(samp->zco, zco);
bound_rectf((rctf *)&root.box, samp->zco);
}
}
@@ -2479,7 +2479,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
samp->facenr= apn->p[a] & ~RE_QUAD_OFFS;
samp->shadfac= &apn->shadfac[a];
- VECCOPY(samp->zco, zco);
+ copy_v3_v3(samp->zco, zco);
bound_rectf((rctf *)&root.box, samp->zco);
}
}
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index 55d3703d351..1852dfaebab 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -127,8 +127,8 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
if(shi->passflag & SCE_PASS_SHADOW)
VECADDISFAC(shr->shad, shr_t.shad, fac);
- VECMUL(shi->vn, -1.0f);
- VECMUL(shi->facenor, -1.0f);
+ negate_v3(shi->vn);
+ negate_v3(shi->facenor);
}
/* depth >= 1 when ray-shading */
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index ddcffcc303b..633c7ca1847 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -139,12 +139,9 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint)
spoint->dtco[1]= data[0]*p[0][1] + data[1]*p[1][1] + data[2]*p[2][1] + data[3]*p[3][1];
spoint->dtco[2]= data[0]*p[0][2] + data[1]*p[1][2] + data[2]*p[2][2] + data[3]*p[3][2];
- copy_v3_v3(spoint->tan, spoint->dtco);
- normalize_v3(spoint->tan);
-
- copy_v3_v3(spoint->nor, spoint->co);
- VECMUL(spoint->nor, -1.0f);
- normalize_v3(spoint->nor);
+ normalize_v3_v3(spoint->tan, spoint->dtco);
+ normalize_v3_v3(spoint->nor, spoint->co);
+ negate_v3(spoint->nor);
spoint->width= strand_eval_width(ma, spoint->strandco);
diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c
index 11d7d9342f7..29eea081672 100644
--- a/source/blender/render/intern/source/volume_precache.c
+++ b/source/blender/render/intern/source/volume_precache.c
@@ -623,7 +623,7 @@ static void precache_init_parts(Render *re, RayObject *tree, ShadeInput *shi, Ob
copy_v3_v3(pa->bbmin, bbmin);
copy_v3_v3(pa->voxel, voxel);
- VECCOPY(pa->res, res); /* int's */
+ copy_v3_v3_int(pa->res, res);
pa->minx = minx; pa->maxx = maxx;
pa->miny = miny; pa->maxy = maxy;
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index d624751f613..57ff5f4237a 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -241,7 +241,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
size_t i;
float *heat;
- VECCOPY(vd->resol, smd->domain->res);
+ copy_v3_v3_int(vd->resol, smd->domain->res);
totRes= vd_resol_size(vd);
// scaling heat values from -2.0-2.0 to 0.0-1.0
@@ -262,7 +262,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
size_t i;
float *xvel, *yvel, *zvel;
- VECCOPY(vd->resol, smd->domain->res);
+ copy_v3_v3_int(vd->resol, smd->domain->res);
totRes= vd_resol_size(vd);
// scaling heat values from -2.0-2.0 to 0.0-1.0
@@ -286,7 +286,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
smoke_turbulence_get_res(smd->domain->wt, vd->resol);
density = smoke_turbulence_get_density(smd->domain->wt);
} else {
- VECCOPY(vd->resol, smd->domain->res);
+ copy_v3_v3_int(vd->resol, smd->domain->res);
density = smoke_get_density(smd->domain->fluid);
}