code cleanup: use min/max functions rather then macros.

This commit is contained in:
2012-11-07 12:31:05 +00:00
parent 5850e62262
commit 34fecdd60e
20 changed files with 43 additions and 62 deletions

View File

@@ -4296,7 +4296,7 @@ static void finalize_render_object(Render *re, ObjectRen *obr, int timeoffset)
/* compute average bounding box of strandpoint itself (width) */
if (obr->strandbuf->flag & R_STRAND_B_UNITS)
obr->strandbuf->maxwidth= MAX2(obr->strandbuf->ma->strand_sta, obr->strandbuf->ma->strand_end);
obr->strandbuf->maxwidth = max_ff(obr->strandbuf->ma->strand_sta, obr->strandbuf->ma->strand_end);
else
obr->strandbuf->maxwidth= 0.0f;

View File

@@ -2507,8 +2507,8 @@ int RE_WriteEnvmapResult(struct ReportList *reports, Scene *scene, EnvMap *env,
if (env->type == ENV_CUBE) {
for (i = 0; i < 12; i += 2) {
maxX = MAX2(maxX, layout[i] + 1);
maxY = MAX2(maxY, layout[i + 1] + 1);
maxX = max_ii(maxX, (int)layout[i] + 1);
maxY = max_ii(maxY, (int)layout[i + 1] + 1);
}
ibuf = IMB_allocImBuf(maxX * dx, maxY * dx, 24, IB_rectfloat);

View File

@@ -637,7 +637,7 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
maxtotvert= 0;
for (obr=re->objecttable.first; obr; obr=obr->next)
maxtotvert= MAX2(obr->totvert, maxtotvert);
maxtotvert = max_ii(obr->totvert, maxtotvert);
clipflag= MEM_callocN(sizeof(char)*maxtotvert, "autoclipflag");