diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-08 22:37:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-08 22:37:06 +0400 |
commit | f0951f58ca2ffb1a7574beaac3217d3729e706c0 (patch) | |
tree | 083fa0fec7f5acc563902584b8c3c015f852bbcb /source/blender/render/intern | |
parent | 0b5a995cfdca70c844186a3af9b2a01fed5e5d3f (diff) |
code cleanup: rename G.afbreek --> is_break, G.rendering --> is_rendering
Diffstat (limited to 'source/blender/render/intern')
7 files changed, 32 insertions, 31 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index ee7372d9848..f34bd352e62 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -309,7 +309,7 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void), totstar++; } /* do not call blender_test_break() here, since it is used in UI as well, confusing the callback system */ - /* main cause is G.afbreek of course, a global again... (ton) */ + /* main cause is G.is_break of course, a global again... (ton) */ } } if (termfunc) termfunc(); @@ -1613,7 +1613,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if (part->type==PART_HAIR && !psys->childcache) totchild= 0; - if (G.rendering == 0) { /* preview render */ + if (G.is_rendering == FALSE) { /* preview render */ totchild = (int)((float)totchild * (float)part->disp / 100.0f); } @@ -3876,7 +3876,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) if (la->mtex[c]->mapto & LAMAP_SHAD) lar->mode |= LA_SHAD_TEX; - if (G.rendering) { + if (G.is_rendering) { if (re->osa) { if (la->mtex[c]->tex->type==TEX_IMAGE) lar->mode |= LA_OSATEX; } @@ -4650,7 +4650,7 @@ void RE_Database_Free(Render *re) LampRen *lar; /* statistics for debugging render memory usage */ - if ((G.debug & G_DEBUG) && (G.rendering)) { + if ((G.debug & G_DEBUG) && (G.is_rendering)) { if ((re->r.scemode & R_PREVIEWBUTS)==0) { BKE_image_print_memlist(); MEM_printmemlist_stats(); diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 1180e74d391..487271ea1f7 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -331,7 +331,7 @@ int RE_engine_render(Render *re, int do_all) RE_engine_free(engine); if (BKE_reports_contain(re->reports, RPT_ERROR)) - G.afbreek = 1; + G.is_break = TRUE; return 1; } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index d4bdf0633f0..3d2b1608906 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -138,7 +138,7 @@ static void result_nothing(void *UNUSED(arg), RenderResult *UNUSED(rr)) {} static void result_rcti_nothing(void *UNUSED(arg), RenderResult *UNUSED(rr), volatile struct rcti *UNUSED(rect)) {} static void stats_nothing(void *UNUSED(arg), RenderStats *UNUSED(rs)) {} static void float_nothing(void *UNUSED(arg), float UNUSED(val)) {} -static int default_break(void *UNUSED(arg)) {return G.afbreek == 1;} +static int default_break(void *UNUSED(arg)) { return G.is_break == TRUE; } static void stats_background(void *UNUSED(arg), RenderStats *rs) { @@ -1199,7 +1199,7 @@ static void do_render_fields_blur_3d(Render *re) /* also check for camera here */ if (camera == NULL) { printf("ERROR: Cannot render, no camera\n"); - G.afbreek = 1; + G.is_break = TRUE; return; } @@ -1495,7 +1495,7 @@ void RE_MergeFullSample(Render *re, Main *bmain, Scene *sce, bNodeTree *ntree) bNode *node; /* default start situation */ - G.afbreek = 0; + G.is_break = FALSE; re->main = bmain; re->scene = sce; @@ -2034,7 +2034,7 @@ void RE_SetReports(Render *re, ReportList *reports) void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *srl, Object *camera_override, unsigned int lay, int frame, const short write_still) { /* ugly global still... is to prevent preview events and signal subsurfs etc to make full resol */ - G.rendering = 1; + G.is_rendering = TRUE; scene->r.cfra = frame; @@ -2045,7 +2045,7 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr do_render_all_options(re); - if (write_still && !G.afbreek) { + if (write_still && !G.is_break) { if (BKE_imtype_is_movie(scene->r.im_format.imtype)) { /* operator checks this but in case its called from elsewhere */ printf("Error: cant write single images with a movie format!\n"); @@ -2062,10 +2062,10 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */ } - BLI_callback_exec(re->main, (ID *)scene, G.afbreek ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE); + BLI_callback_exec(re->main, (ID *)scene, G.is_break ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE); /* UGLY WARNING */ - G.rendering = 0; + G.is_rendering = FALSE; } static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovieHandle *mh, const char *name_override) @@ -2161,16 +2161,16 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri /* ugly global still... is to prevent renderwin events and signal subsurfs etc to make full resol */ /* is also set by caller renderwin.c */ - G.rendering = 1; + G.is_rendering = TRUE; re->flag |= R_ANIMATION; if (BKE_imtype_is_movie(scene->r.im_format.imtype)) if (!mh->start_movie(scene, &re->r, re->rectx, re->recty, re->reports)) - G.afbreek = 1; + G.is_break = TRUE; if (mh->get_next_frame) { - while (!(G.afbreek == 1)) { + while (!(G.is_break == 1)) { int nf = mh->get_next_frame(&re->r, re->reports); if (nf >= 0 && nf >= scene->r.sfra && nf <= scene->r.efra) { scene->r.cfra = re->r.cfra = nf; @@ -2182,16 +2182,17 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri if (re->test_break(re->tbh) == 0) { if (!do_write_image_or_movie(re, bmain, scene, mh, NULL)) - G.afbreek = 1; + G.is_break = TRUE; } - if (G.afbreek == 0) { + if (G.is_break == FALSE) { BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */ } } else { - if (re->test_break(re->tbh)) - G.afbreek = 1; + if (re->test_break(re->tbh)) { + G.is_break = TRUE; + } } } } @@ -2247,14 +2248,14 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri totrendered++; if (re->test_break(re->tbh) == 0) { - if (!G.afbreek) + if (!G.is_break) if (!do_write_image_or_movie(re, bmain, scene, mh, NULL)) - G.afbreek = 1; + G.is_break = TRUE; } else - G.afbreek = 1; + G.is_break = TRUE; - if (G.afbreek == 1) { + if (G.is_break == TRUE) { /* remove touched file */ if (BKE_imtype_is_movie(scene->r.im_format.imtype) == 0) { if (scene->r.mode & R_TOUCH && BLI_exists(name) && BLI_file_size(name) == 0) { @@ -2265,7 +2266,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri break; } - if (G.afbreek == 0) { + if (G.is_break == FALSE) { BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */ } } @@ -2282,10 +2283,10 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri re->flag &= ~R_ANIMATION; - BLI_callback_exec(re->main, (ID *)scene, G.afbreek ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE); + BLI_callback_exec(re->main, (ID *)scene, G.is_break ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE); /* UGLY WARNING */ - G.rendering = 0; + G.is_rendering = FALSE; } void RE_PreviewRender(Render *re, Main *bmain, Scene *sce) diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index e5bbb212def..3d0816e048d 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -112,7 +112,7 @@ static void init_render_texture(Render *re, Tex *tex) tex->extend= TEX_EXTEND; /* only free envmap when rendermode was set to render envmaps, for previewrender */ - if (G.rendering && re) { + if (G.is_rendering && re) { if (re->r.mode & R_ENVMAP) if (tex->env->stype==ENV_ANIM) BKE_free_envmapdata(tex->env); diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 4c90c3b4a6f..90876610f1a 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -848,7 +848,7 @@ void threaded_makeshadowbufs(Render *re) int (*test_break)(void *); /* count number of threads to use */ - if (G.rendering) { + if (G.is_rendering) { for (lar=re->lampren.first; lar; lar= lar->next) if (lar->shb) totthread++; diff --git a/source/blender/render/intern/source/texture_ocean.c b/source/blender/render/intern/source/texture_ocean.c index 5071303dff7..b842cab1d29 100644 --- a/source/blender/render/intern/source/texture_ocean.c +++ b/source/blender/render/intern/source/texture_ocean.c @@ -88,7 +88,7 @@ int ocean_texture(Tex *tex, float *texvec, TexResult *texres) } else { /* non-cached */ - if (G.rendering) + if (G.is_rendering) BKE_ocean_eval_uv_catrom(omd->ocean, &ocr, u, v); else BKE_ocean_eval_uv(omd->ocean, &ocr, u, v); diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 8d228473de7..de9572bf57b 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -3975,9 +3975,9 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas if (R.test_break(R.tbh)) return NULL; - if (R.osa>16) { /* MAX_OSA */ + if (R.osa > 16) { /* MAX_OSA */ printf("zbuffer_transp_shade: osa too large\n"); - G.afbreek= 1; + G.is_break = TRUE; return NULL; } |