diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-19 17:28:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-19 17:28:19 +0400 |
commit | af3e348430218e609c80d86c8dd418bed15e70e8 (patch) | |
tree | a93e0453c8fe47a954594060cc5bbda90214a7f3 /source/blender/render/intern | |
parent | 2f5173887e0c7f6ba19664f16b177e575d82a241 (diff) |
code cleanup: use TRUE/FALSE rather then 1/0 for better readability, also replace do prefix with do_ for bool vars.
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 40 | ||||
-rw-r--r-- | source/blender/render/intern/source/envmap.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/initrender.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 8 | ||||
-rw-r--r-- | source/blender/render/intern/source/pixelshading.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/rayshade.c | 16 | ||||
-rw-r--r-- | source/blender/render/intern/source/render_texture.c | 34 | ||||
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 28 | ||||
-rw-r--r-- | source/blender/render/intern/source/renderdatabase.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/shadeoutput.c | 22 | ||||
-rw-r--r-- | source/blender/render/intern/source/sss.c | 10 |
11 files changed, 89 insertions, 83 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index c2b0e1e777f..a1cc1e23470 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -168,7 +168,7 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void), float vec[4], fx, fy, fz; float fac, starmindist, clipend; float mat[4][4], stargrid, maxrand, maxjit, force, alpha; - int x, y, z, sx, sy, sz, ex, ey, ez, done = 0; + int x, y, z, sx, sy, sz, ex, ey, ez, done = FALSE; unsigned int totstar= 0; if (initfunc) { @@ -683,7 +683,7 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, int do_tangen } } - if (do_nmap_tangent != 0) { + if (do_nmap_tangent != FALSE) { SRenderMeshToTangent mesh2tangent; SMikkTSpaceContext sContext; SMikkTSpaceInterface sInterface; @@ -1575,7 +1575,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem float pa_time, pa_birthtime, pa_dietime; float random, simplify[2], pa_co[3]; const float cfra= BKE_scene_frame_get(re->scene); - int i, a, k, max_k=0, totpart, dosimplify = 0, dosurfacecache = 0, use_duplimat = 0; + int i, a, k, max_k=0, totpart, do_simplify = FALSE, do_surfacecache = FALSE, use_duplimat = FALSE; int totchild=0; int seed, path_nbr=0, orco1=0, num; int totface, *origindex = 0; @@ -1697,7 +1697,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if (psys->flag & PSYS_USE_IMAT) { /* psys->imat is the original emitter's inverse matrix, ob->obmat is the duplicated object's matrix */ mult_m4_m4m4(duplimat, ob->obmat, psys->imat); - use_duplimat = 1; + use_duplimat = TRUE; } /* 2.6 setup strand rendering */ @@ -1744,10 +1744,10 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem svert= strandbuf->vert; if (re->r.mode & R_SPEED) - dosurfacecache= 1; + do_surfacecache = TRUE; else if ((re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) && (re->wrld.ao_gather_method == WO_AOGATHER_APPROX)) if (ma->amb != 0.0f) - dosurfacecache= 1; + do_surfacecache = TRUE; totface= psmd->dm->getNumTessFaces(psmd->dm); origindex= psmd->dm->getTessFaceDataArray(psmd->dm, CD_ORIGINDEX); @@ -1860,7 +1860,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem get_particle_uvco_mcol(part->from, psmd->dm, parent->fuv, num, &sd); } - dosimplify = psys_render_simplify_params(psys, cpa, simplify); + do_simplify = psys_render_simplify_params(psys, cpa, simplify); if (strandbuf) { int orignum= (origindex)? origindex[cpa->num]: cpa->num; @@ -1892,7 +1892,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem strand->vert= svert; copy_v3_v3(strand->orco, sd.orco); - if (dosimplify) { + if (do_simplify) { float *ssimplify= RE_strandren_get_simplify(obr, strand, 1); ssimplify[0]= simplify[0]; ssimplify[1]= simplify[1]; @@ -1903,7 +1903,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem copy_v3_v3(snor, sd.surfnor); } - if (dosurfacecache && num >= 0) { + if (do_surfacecache && num >= 0) { int *facenum= RE_strandren_get_face(obr, strand, 1); *facenum= num; } @@ -2084,7 +2084,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem break; } - if (dosurfacecache) + if (do_surfacecache) strandbuf->surface= cache_strand_surface(re, obr, psmd->dm, mat, timeoffset); /* 4. clean up */ @@ -3263,8 +3263,8 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) float *orco=0; int need_orco=0, need_stress=0, need_nmap_tangent=0, need_tangent=0; int a, a1, ok, vertofs; - int end, do_autosmooth=0, totvert = 0; - int use_original_normals= 0; + int end, do_autosmooth = FALSE, totvert = 0; + int use_original_normals = FALSE; int recalc_normals = 0; // false by default int negative_scale; @@ -3339,7 +3339,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) /* attempt to autsmooth on original mesh, only without subsurf */ if (do_autosmooth && me->totvert==totvert && me->totface==dm->getNumTessFaces(dm)) - use_original_normals= 1; + use_original_normals= TRUE; ms = (totvert==me->totvert)?me->msticky:NULL; @@ -3354,7 +3354,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) for (a=0; a<totvert; a++, mvert++) { ver= RE_findOrAddVert(obr, obr->totvert++); copy_v3_v3(ver->co, mvert->co); - if (do_autosmooth==0) { /* autosmooth on original unrotated data to prevent differences between frames */ + if (do_autosmooth == FALSE) { /* autosmooth on original unrotated data to prevent differences between frames */ normal_short_to_float_v3(ver->n, mvert->no); mul_m4_v3(mat, ver->co); mul_transposed_m3_v3(imat, ver->n); @@ -3416,7 +3416,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) if ( mface->mat_nr==a1 ) { float len; - int reverse_verts = negative_scale!=0 && do_autosmooth==0; + int reverse_verts = (negative_scale != 0 && do_autosmooth == FALSE); int rev_tab[] = {reverse_verts==0 ? 0 : 2, 1, reverse_verts==0 ? 2 : 0, 3}; v1= reverse_verts==0 ? mface->v1 : mface->v3; v2= mface->v2; @@ -4703,7 +4703,7 @@ void RE_Database_Free(Render *re) free_strand_surface(re); re->totvlak=re->totvert=re->totstrand=re->totlamp=re->tothalo= 0; - re->i.convertdone= 0; + re->i.convertdone = FALSE; re->bakebuf= NULL; @@ -5045,7 +5045,7 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l re->lampren.first= re->lampren.last= NULL; slurph_opt= 0; - re->i.partsdone= 0; /* signal now in use for previewrender */ + re->i.partsdone = FALSE; /* signal now in use for previewrender */ /* in localview, lamps are using normal layers, objects only local bits */ if (re->lay & 0xFF000000) @@ -5164,7 +5164,7 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l if (re->test_break(re->tbh)) RE_Database_Free(re); else - re->i.convertdone= 1; + re->i.convertdone = TRUE; re->i.infostr= NULL; re->stats_draw(re->sdh, &re->i); @@ -5651,8 +5651,8 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned // NT check for fluidsim special treatment fluidmd = (FluidsimModifierData *)modifiers_findByType(obi->ob, eModifierType_Fluidsim); if (fluidmd && fluidmd->fss && (fluidmd->fss->type & OB_FLUIDSIM_DOMAIN)) { - // use preloaded per vertex simulation data, only does calculation for step=1 - // NOTE/FIXME - velocities and meshes loaded unnecessarily often during the database_fromscene_vectors calls... + /* use preloaded per vertex simulation data, only does calculation for step=1 */ + /* NOTE/FIXME - velocities and meshes loaded unnecessarily often during the database_fromscene_vectors calls... */ load_fluidsimspeedvectors(re, obi, oldobi->vectors, step); } else { diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index eebcf23a7a6..6714fe1a29d 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -505,7 +505,7 @@ static void render_envmap(Render *re, EnvMap *env) void make_envmaps(Render *re) { Tex *tex; - int do_init= 0, depth= 0, trace; + int do_init = FALSE, depth= 0, trace; if (!(re->r.mode & R_ENVMAP)) return; @@ -559,7 +559,7 @@ void make_envmaps(Render *re) if (env->ok==0 && depth==0) env->recalc= 1; if (env->ok==0) { - do_init= 1; + do_init = TRUE; render_envmap(re, env); if (depth==env->depth) env->recalc= 0; diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index e712950f4f8..c0382834987 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -549,7 +549,7 @@ void initparts(Render *re) /* this is render info for caller, is not reset when parts are freed! */ re->i.totpart= 0; re->i.curpart= 0; - re->i.partsdone= 0; + re->i.partsdone = FALSE; /* just for readable code.. */ xminb= re->disprect.xmin; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 79f94c77dde..7549207af87 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1302,7 +1302,7 @@ static int composite_needs_render(Scene *sce, int this_scene) bNode *node; if (ntree==NULL) return 1; - if (sce->use_nodes==0) return 1; + if (sce->use_nodes == FALSE) return 1; if ((sce->r.scemode & R_DOCOMP)==0) return 1; for (node= ntree->nodes.first; node; node= node->next) { @@ -2074,18 +2074,18 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie /* write movie or image */ if (BKE_imtype_is_movie(scene->r.im_format.imtype)) { - int dofree = 0; + int do_free = FALSE; unsigned int *rect32 = (unsigned int *)rres.rect32; /* note; the way it gets 32 bits rects is weak... */ if (rres.rect32 == NULL) { rect32 = MEM_mapallocN(sizeof(int)*rres.rectx*rres.recty, "temp 32 bits rect"); RE_ResultGet32(re, rect32); - dofree = 1; + do_free = TRUE; } ok= mh->append_movie(&re->r, scene->r.sfra, scene->r.cfra, (int *)rect32, rres.rectx, rres.recty, re->reports); - if (dofree) { + if (do_free) { MEM_freeN(rect32); } printf("Append frame %d", scene->r.cfra); diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index ac48a5f41f2..0aeee7e22e8 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -566,7 +566,7 @@ void shadeSunView(float col_r[3], const float view[3]) GroupObject *go; LampRen *lar; float sview[3]; - int do_init= 1; + int do_init = TRUE; for (go=R.lights.first; go; go= go->next) { lar= go->lampren; @@ -581,7 +581,7 @@ void shadeSunView(float col_r[3], const float view[3]) if (sview[2] < 0.0f) sview[2] = 0.0f; normalize_v3(sview); - do_init= 0; + do_init = FALSE; } GetSkyXYZRadiancef(lar->sunsky, sview, colorxyz); diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index f550cd82061..726d89a7c3e 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -721,7 +721,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con shi.lay= origshi->lay; shi.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */ shi.combinedflag= 0xFFFFFF; /* ray trace does all options */ - //shi.do_preview= 0; // memset above, so don't need this + //shi.do_preview = FALSE; // memset above, so don't need this shi.light_override= origshi->light_override; shi.mat_override= origshi->mat_override; @@ -1176,13 +1176,13 @@ static QMCSampler *get_thread_qmcsampler(Render *re, int thread, int type, int t for (qsa=re->qmcsamplers[thread].first; qsa; qsa=qsa->next) { if (qsa->type == type && qsa->tot == tot && !qsa->used) { - qsa->used= 1; + qsa->used = TRUE; return qsa; } } qsa= QMC_initSampler(type, tot); - qsa->used= 1; + qsa->used = TRUE; BLI_addtail(&re->qmcsamplers[thread], qsa); return qsa; @@ -1483,8 +1483,8 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr) float diff[3]; int do_tra, do_mir; - do_tra= ((shi->mode & MA_TRANSP) && (shi->mode & MA_RAYTRANSP) && shr->alpha!=1.0f && (shi->depth <= shi->mat->ray_depth_tra)); - do_mir= ((shi->mat->mode & MA_RAYMIRROR) && shi->ray_mirror!=0.0f && (shi->depth <= shi->mat->ray_depth)); + do_tra = ((shi->mode & MA_TRANSP) && (shi->mode & MA_RAYTRANSP) && shr->alpha != 1.0f && (shi->depth <= shi->mat->ray_depth_tra)); + do_mir = ((shi->mat->mode & MA_RAYMIRROR) && shi->ray_mirror != 0.0f && (shi->depth <= shi->mat->ray_depth)); /* raytrace mirror and refract like to separate the spec color */ if (shi->combinedflag & SCE_PASS_SPEC) @@ -2195,7 +2195,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3], float adapt_thresh = lar->adapt_thresh; int min_adapt_samples=4, max_samples = lar->ray_totsamp; float *co; - int do_soft=1, full_osa=0, i; + int do_soft = TRUE, full_osa = FALSE, i; float min[3], max[3]; RayHint bb_hint; @@ -2210,8 +2210,8 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3], else shadfac[3]= 1.0f; - if (lar->ray_totsamp < 2) do_soft = 0; - if ((R.r.mode & R_OSA) && (R.osa > 0) && (shi->vlr->flag & R_FULL_OSA)) full_osa = 1; + if (lar->ray_totsamp < 2) do_soft = FALSE; + if ((R.r.mode & R_OSA) && (R.osa > 0) && (shi->vlr->flag & R_FULL_OSA)) full_osa = TRUE; if (full_osa) { if (do_soft) max_samples = max_samples/R.osa + 1; diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 58a4e7c9828..bf18c04cd73 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -1367,7 +1367,7 @@ int multitex_ext_safe(Tex *tex, float *texvec, TexResult *texres) { int use_nodes= tex->use_nodes, retval; - tex->use_nodes= 0; + tex->use_nodes = FALSE; retval= multitex_nodes(tex, texvec, NULL, NULL, 0, texres, 0, 0, NULL, NULL); tex->use_nodes= use_nodes; @@ -1714,7 +1714,7 @@ static void compatible_bump_uv_derivs(CompatibleBump *compat_bump, ShadeInput *s compat_bump->nn[1] = -shi->vn[1]; compat_bump->nn[2] = -shi->vn[2]; ortho_basis_v3v3_v3(compat_bump->nu, compat_bump->nv, compat_bump->nn); - compat_bump->nunvdone= 1; + compat_bump->nunvdone = TRUE; } if (tf) { @@ -1766,7 +1766,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi, // render normal is negated negate_v3_v3(compat_bump->nn, shi->vn); ortho_basis_v3v3_v3(compat_bump->nu, compat_bump->nv, compat_bump->nn); - compat_bump->nunvdone= 1; + compat_bump->nunvdone = TRUE; } // two methods, either constant based on main image resolution, @@ -1946,7 +1946,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T ntap_bump->fPrevMagnitude = 1.0f; ntap_bump->iPrevBumpSpace = 0; - ntap_bump->init_done = 1; + ntap_bump->init_done = TRUE; } // resolve image dimensions @@ -2171,8 +2171,8 @@ void do_material_tex(ShadeInput *shi, Render *re) float *co = NULL, *dx = NULL, *dy = NULL; float fact, facm, factt, facmm, stencilTin=1.0; float texvec[3], dxt[3], dyt[3], tempvec[3], norvec[3], warpvec[3]={0.0f, 0.0f, 0.0f}, Tnor=1.0; - int tex_nr, rgbnor= 0, warpdone=0; - int use_compat_bump = 0, use_ntap_bump = 0; + int tex_nr, rgbnor= 0, warp_done = FALSE; + int use_compat_bump = FALSE, use_ntap_bump = FALSE; int found_nmapping = 0, found_deriv_map = 0; int iFirstTimeNMap=1; @@ -2195,24 +2195,24 @@ void do_material_tex(ShadeInput *shi, Render *re) found_deriv_map = (tex->type==TEX_IMAGE) && (tex->imaflag & TEX_DERIVATIVEMAP); use_compat_bump= (mtex->texflag & MTEX_COMPAT_BUMP); - use_ntap_bump= ((mtex->texflag & (MTEX_3TAP_BUMP|MTEX_5TAP_BUMP|MTEX_BICUBIC_BUMP))!=0 || found_deriv_map!=0) ? 1 : 0; + use_ntap_bump = ((mtex->texflag & (MTEX_3TAP_BUMP|MTEX_5TAP_BUMP|MTEX_BICUBIC_BUMP))!=0 || found_deriv_map!=0) ? TRUE : FALSE; /* XXX texture node trees don't work for this yet */ if (tex->nodetree && tex->use_nodes) { - use_compat_bump = 0; - use_ntap_bump = 0; + use_compat_bump = FALSE; + use_ntap_bump = FALSE; } /* case displacement mapping */ - if (shi->osatex==0 && use_ntap_bump) { - use_ntap_bump = 0; - use_compat_bump = 1; + if (shi->osatex == 0 && use_ntap_bump) { + use_ntap_bump = FALSE; + use_compat_bump = TRUE; } /* case ocean */ if (tex->type == TEX_OCEAN) { - use_ntap_bump = 0; - use_compat_bump = 0; + use_ntap_bump = FALSE; + use_compat_bump = FALSE; } /* which coords */ @@ -2322,7 +2322,7 @@ void do_material_tex(ShadeInput *shi, Render *re) } else texres.nor= NULL; - if (warpdone) { + if (warp_done) { add_v3_v3v3(tempvec, co, warpvec); co= tempvec; } @@ -2409,7 +2409,7 @@ void do_material_tex(ShadeInput *shi, Render *re) warpvec[0]= mtex->warpfac*warpnor[0]; warpvec[1]= mtex->warpfac*warpnor[1]; warpvec[2]= mtex->warpfac*warpnor[2]; - warpdone= 1; + warp_done = TRUE; } #if 0 if (mtex->texflag & MTEX_VIEWSPACE) { @@ -2681,7 +2681,7 @@ void do_material_tex(ShadeInput *shi, Render *re) } } } - if ((use_compat_bump || use_ntap_bump || found_nmapping) && (shi->mat->mode & MA_TANGENT_V)!=0) { + if ((use_compat_bump || use_ntap_bump || found_nmapping) && (shi->mat->mode & MA_TANGENT_V) != 0) { const float fnegdot = -dot_v3v3(shi->vn, shi->tang); // apply Gram-Schmidt projection madd_v3_v3fl(shi->tang, shi->vn, fnegdot); diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 0dc7f35dc56..2fd8e49d34e 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -683,7 +683,7 @@ static void sky_tile(RenderPart *pa, RenderLayer *rl) for (y=pa->disprect.ymin; y<pa->disprect.ymax; y++) { for (x=pa->disprect.xmin; x<pa->disprect.xmax; x++, od+=4) { float col[4]; - int sample, done= 0; + int sample, done = FALSE; for (sample= 0; sample<totsample; sample++) { float *pass= rlpp[sample]->rectf + od; @@ -692,7 +692,7 @@ static void sky_tile(RenderPart *pa, RenderLayer *rl) if (done==0) { shadeSkyPixel(col, x, y, pa->thread); - done= 1; + done = TRUE; } if (pass[3]==0.0f) { @@ -748,7 +748,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl) float *zrect= RE_RenderLayerGetPass(rlpp[sample], SCE_PASS_Z) + od; float *rgbrect = rlpp[sample]->rectf + 4*od; float rgb[3] = {0}; - int done= 0; + int done = FALSE; for (go=R.lights.first; go; go= go->next) { @@ -780,7 +780,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl) if (done==0) { copy_v3_v3(rgb, tmp_rgb); - done = 1; + done = TRUE; } else { rgb[0] = 0.5f*rgb[0] + 0.5f*tmp_rgb[0]; @@ -1935,7 +1935,7 @@ void add_halo_flare(Render *re) RenderResult *rr= re->result; RenderLayer *rl; HaloRen *har; - int a, mode, do_draw=0; + int a, mode, do_draw = FALSE; /* for now, we get the first renderlayer in list with halos set */ for (rl= rr->layers.first; rl; rl= rl->next) @@ -1954,7 +1954,7 @@ void add_halo_flare(Render *re) har= R.sortedhalos[a]; if (har->flarec) { - do_draw= 1; + do_draw = TRUE; renderflare(rr, rl->rectf, har); } } @@ -1988,7 +1988,7 @@ typedef struct BakeShade { unsigned int *rect; float *rect_float; - int usemask; + int use_mask; char *rect_mask; /* bake pixel mask */ float dxco[3], dyco[3]; @@ -2408,12 +2408,12 @@ static int get_next_bake_face(BakeShade *bs) ObjectRen *obr; VlakRen *vlr; MTFace *tface; - static int v= 0, vdone= 0; + static int v= 0, vdone = FALSE; static ObjectInstanceRen *obi= NULL; if (bs==NULL) { vlr= NULL; - v= vdone= 0; + v= vdone = FALSE; obi= R.instancetable.first; return 0; } @@ -2507,7 +2507,7 @@ static void shade_tface(BakeShade *bs) bs->rect_float= bs->ibuf->rect_float; bs->quad= 0; - if (bs->usemask) { + if (bs->use_mask) { if (bs->ibuf->userdata==NULL) { BLI_lock_thread(LOCK_CUSTOM1); if (bs->ibuf->userdata==NULL) /* since the thread was locked, its possible another thread alloced the value */ @@ -2594,7 +2594,7 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up BakeShade *handles; ListBase threads; Image *ima; - int a, vdone=0, usemask=0, result=BAKE_RESULT_OK; + int a, vdone = FALSE, use_mask = FALSE, result = BAKE_RESULT_OK; /* initialize render global */ R= *re; @@ -2605,7 +2605,7 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up /* do we need a mask? */ if (re->r.bake_filter) - usemask = 1; + use_mask = TRUE; /* baker uses this flag to detect if image was initialized */ for (ima= G.main->image.first; ima; ima= ima->id.next) { @@ -2642,7 +2642,7 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up handles[a].actob= actob; handles[a].zspan= MEM_callocN(sizeof(ZSpan), "zspan for bake"); - handles[a].usemask = usemask; + handles[a].use_mask = use_mask; handles[a].do_update = do_update; /* use to tell the view to update */ @@ -2655,7 +2655,7 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up PIL_sleep_ms(50); /* calculate progress */ - for (vdone=0, a=0; a<re->r.threads; a++) + for (vdone = FALSE, a=0; a<re->r.threads; a++) vdone+= handles[a].vdone; if (progress) *progress = (float)(vdone / (float)re->totvlak); diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index 4a9e4be7f86..bc61a26564d 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -1205,7 +1205,9 @@ static int panotestclip(Render *re, int do_pano, float *v) float abs4; short c=0; - if (do_pano==0) return testclip(v); + if (do_pano == FALSE) { + return testclip(v); + } abs4= fabs(v[3]); diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 53d06893a3f..a0f5caa826b 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -161,7 +161,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) double a, b, c, disc, nray[3], npos[3]; double t0, t1 = 0.0f, t2= 0.0f, t3; float p1[3], p2[3], ladist, maxz = 0.0f, maxy = 0.0f, haint; - int snijp, doclip=1, use_yco=0; + int snijp, do_clip = TRUE, use_yco = FALSE; *intens= 0.0f; haint= lar->haint; @@ -196,7 +196,9 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) /* rotate maxz */ - if (shi->co[2]==0.0f) doclip= 0; /* for when halo at sky */ + if (shi->co[2]==0.0f) { + do_clip = FALSE; /* for when halo at sky */ + } else { p1[0]= shi->co[0]-lar->co[0]; p1[1]= shi->co[1]-lar->co[1]; @@ -206,7 +208,9 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) maxz*= lar->sh_zfac; maxy= lar->imat[0][1]*p1[0]+lar->imat[1][1]*p1[1]+lar->imat[2][1]*p1[2]; - if ( fabs(nray[2]) < FLT_EPSILON ) use_yco= 1; + if (fabsf(nray[2]) < FLT_EPSILON) { + use_yco = TRUE; + } } /* scale z to make sure volume is normalized */ @@ -261,7 +265,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) if (ok1==0 && ok2==0) return; /* intersction point with -ladist, the bottom of the cone */ - if (use_yco==0) { + if (use_yco == FALSE) { t3= ((double)(-ladist)-npos[2])/nray[2]; /* de we have to replace one of the intersection points? */ @@ -294,12 +298,12 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) } /* calculate t0: is the maximum visible z (when halo is intersected by face) */ - if (doclip) { - if (use_yco==0) t0= (maxz-npos[2])/nray[2]; - else t0= (maxy-npos[1])/nray[1]; + if (do_clip) { + if (use_yco == FALSE) t0 = (maxz - npos[2]) / nray[2]; + else t0 = (maxy - npos[1]) / nray[1]; - if (t0<t1) return; - if (t0<t2) t2= t0; + if (t0 < t1) return; + if (t0 < t2) t2= t0; } /* calc points */ diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c index 690598d8c05..061cb7852db 100644 --- a/source/blender/render/intern/source/sss.c +++ b/source/blender/render/intern/source/sss.c @@ -652,7 +652,7 @@ static void create_octree_node(ScatterTree *tree, ScatterNode *node, float *mid, { ScatterNode *subnode; ScatterPoint **subrefpoints, **tmppoints= tree->tmppoints; - int index, nsize[8], noffset[8], i, subco, usednodes, usedi; + int index, nsize[8], noffset[8], i, subco, used_nodes, usedi; float submid[3], subsize[3]; /* stopping condition */ @@ -684,16 +684,16 @@ static void create_octree_node(ScatterTree *tree, ScatterNode *node, float *mid, /* here we check if only one subnode is used. if this is the case, we don't * create a new node, but rather call this function again, with different * size and middle position for the same node. */ - for (usedi=0, usednodes=0, i=0; i<8; i++) { + for (usedi=0, used_nodes=0, i=0; i<8; i++) { if (nsize[i]) { - usednodes++; + used_nodes++; usedi = i; } if (i != 0) noffset[i]= noffset[i-1]+nsize[i-1]; } - if (usednodes<=1) { + if (used_nodes <= 1) { subnode_middle(usedi, mid, subsize, submid); create_octree_node(tree, node, submid, subsize, refpoints, depth+1); return; @@ -874,7 +874,7 @@ static void sss_create_tree_mat(Render *re, Material *mat) re->r.mode &= ~R_OSA; re->sss_points= &points; re->sss_mat= mat; - re->i.partsdone= 0; + re->i.partsdone = FALSE; if (!(re->r.scemode & R_PREVIEWBUTS)) re->result= NULL; |