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>2012-07-29 20:59:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-29 20:59:51 +0400
commitc41e1e434ab9defa35178ad8886d81b60d889e9a (patch)
tree89cc6a948b408865e475ccb1f8c2cf98edac76bc /source/blender/render
parent93ff6f6dff73cf24e591dd2678ee601495714dc7 (diff)
code cleanup: replace MIN2/MAX2 with minf/maxf
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/imagetexture.c28
-rw-r--r--source/blender/render/intern/source/rayshade.c2
-rw-r--r--source/blender/render/intern/source/render_texture.c2
-rw-r--r--source/blender/render/intern/source/rendercore.c3
-rw-r--r--source/blender/render/intern/source/shadbuf.c2
-rw-r--r--source/blender/render/intern/source/sss.c2
-rw-r--r--source/blender/render/intern/source/zbuf.c6
7 files changed, 22 insertions, 23 deletions
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 3e6d0f281fd..c4c89bd06a6 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -980,9 +980,9 @@ static void alpha_clip_aniso(ImBuf *ibuf, float minx, float miny, float maxx, fl
rf.ymin = miny*(ibuf->y);
rf.ymax = maxy*(ibuf->y);
- alphaclip = clipx_rctf(&rf, 0.0, (float)(ibuf->x));
- alphaclip*= clipy_rctf(&rf, 0.0, (float)(ibuf->y));
- alphaclip= MAX2(alphaclip, 0.0f);
+ alphaclip = clipx_rctf(&rf, 0.0, (float)(ibuf->x));
+ alphaclip *= clipy_rctf(&rf, 0.0, (float)(ibuf->y));
+ alphaclip = maxf(alphaclip, 0.0f);
if (alphaclip!=1.0f) {
/* premul it all */
@@ -1236,8 +1236,8 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
float fProbes;
a *= ff;
b *= ff;
- a = MAX2(a, 1.f);
- b = MAX2(b, 1.f);
+ a = maxf(a, 1.0f);
+ b = maxf(b, 1.0f);
fProbes = 2.f*(a / b) - 1.f;
AFD.iProbes = (int)floorf(fProbes + 0.5f);
AFD.iProbes = MIN2(AFD.iProbes, tex->afmax);
@@ -1253,8 +1253,8 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
if (ecc > (float)tex->afmax) b = a / (float)tex->afmax;
b *= ff;
}
- maxd = MAX2(b, 1e-8f);
- levf = ((float)M_LOG2E)*logf(maxd);
+ maxd = maxf(b, 1e-8f);
+ levf = ((float)M_LOG2E) * logf(maxd);
curmap = 0;
maxlev = 1;
@@ -1338,8 +1338,8 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
imp2radangle(A, B, C, F, &a, &b, &th, &ecc);
a *= ff;
b *= ff;
- a = MAX2(a, 1.f);
- b = MAX2(b, 1.f);
+ a = maxf(a, 1.0f);
+ b = maxf(b, 1.0f);
fProbes = 2.f*(a / b) - 1.f;
/* no limit to number of Probes here */
AFD.iProbes = (int)floorf(fProbes + 0.5f);
@@ -1622,12 +1622,12 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
ImBuf *previbuf, *curibuf;
float bumpscale;
- dx= minx;
- dy= miny;
- maxd= MAX2(dx, dy);
- if (maxd>0.5f) maxd= 0.5f;
+ dx = minx;
+ dy = miny;
+ maxd = maxf(dx, dy);
+ if (maxd > 0.5f) maxd = 0.5f;
- pixsize = 1.0f/ (float) MIN2(ibuf->x, ibuf->y);
+ pixsize = 1.0f / (float) MIN2(ibuf->x, ibuf->y);
bumpscale= pixsize/maxd;
if (bumpscale>1.0f) bumpscale= 1.0f;
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index cb7122c834c..aa35d73f3b5 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -1515,7 +1515,7 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
if (!(shi->combinedflag & SCE_PASS_REFRACT))
sub_v3_v3v3(diff, diff, shr->refr);
- shr->alpha= MIN2(1.0f, tracol[3]);
+ shr->alpha = minf(1.0f, tracol[3]);
}
if (do_mir) {
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index d47fdff8076..e5bbb212def 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -1733,7 +1733,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
if (mtex->texco == TEXCO_UV) {
/* for the uv case, use the same value for both du/dv,
* since individually scaling the normal derivatives makes them useless... */
- du = MIN2(du, dv);
+ du = minf(du, dv);
idu = (du < 1e-5f) ? bf : (bf/du);
/* +u val */
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 63aa6cdd139..a6b2c98f9d3 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -1541,8 +1541,7 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
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);
+ *area = minf(len_v3(shi->dxco) * len_v3(shi->dyco), 2.0f * orthoarea);
shade_input_set_uv(shi);
shade_input_set_normals(shi);
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index db9e201704f..4c90c3b4a6f 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -1391,7 +1391,7 @@ float shadow_halo(LampRen *lar, const float p1[3], const float p2[3])
}
}
- labda= MIN2(labdax, labday);
+ labda = minf(labdax, labday);
if (labda==labdao || labda>=1.0f) break;
zf= zf1 + labda*(zf2-zf1);
diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c
index 5ca1262107b..69e738e840d 100644
--- a/source/blender/render/intern/source/sss.c
+++ b/source/blender/render/intern/source/sss.c
@@ -305,7 +305,7 @@ ScatterSettings *scatter_settings_new(float refl, float radius, float ior, float
ss->Fdr= -1.440f/ior*ior + 0.710f/ior + 0.668f + 0.0636f*ior;
ss->A= (1.0f + ss->Fdr)/(1.0f - ss->Fdr);
ss->ld= radius;
- ss->ro= MIN2(refl, 0.999f);
+ ss->ro= minf(refl, 0.999f);
ss->color= ss->ro*reflfac + (1.0f-reflfac);
ss->alpha_= compute_reduced_albedo(ss);
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index e09529fd8ac..8d228473de7 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -149,8 +149,8 @@ static void zbuf_add_to_span(ZSpan *zspan, const float *v1, const float *v2)
xs0= dx0*(minv[1]-my2) + minv[0];
}
else {
- dx0= 0.0f;
- xs0= MIN2(minv[0], maxv[0]);
+ dx0 = 0.0f;
+ xs0 = minf(minv[0], maxv[0]);
}
/* empty span */
@@ -3874,7 +3874,7 @@ static int addtosamp_shr(ShadeResult *samp_shr, ShadeSample *ssamp, int addpassf
addAlphaUnderFloat(samp_shr->combined, shr->combined);
- samp_shr->z= MIN2(samp_shr->z, shr->z);
+ samp_shr->z = minf(samp_shr->z, shr->z);
if (addpassflag & SCE_PASS_VECTOR) {
copy_v4_v4(samp_shr->winspeed, shr->winspeed);