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/editors | |
parent | 0b5a995cfdca70c844186a3af9b2a01fed5e5d3f (diff) |
code cleanup: rename G.afbreek --> is_break, G.rendering --> is_rendering
Diffstat (limited to 'source/blender/editors')
19 files changed, 38 insertions, 38 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 9c9d7f8e34a..620f5de9db7 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -283,7 +283,7 @@ AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale) return NULL; /* abort if rendering - we may get some race condition issues... */ - if (G.rendering) return NULL; + if (G.is_rendering) return NULL; /* handling depends on the type of animation-context we've got */ if (ale) @@ -422,7 +422,7 @@ void ANIM_unit_mapping_apply_fcurve(Scene *scene, ID *id, FCurve *fcu, short fla float fac; /* abort if rendering - we may get some race condition issues... */ - if (G.rendering) return; + if (G.is_rendering) return; /* calculate mapping factor, and abort if nothing to change */ fac = ANIM_unit_mapping_get_factor(scene, id, fcu, (flag & ANIM_UNITCONV_RESTORE)); diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 13741a99d99..1ab6247728a 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -65,7 +65,7 @@ static int change_frame_poll(bContext *C) ScrArea *curarea = CTX_wm_area(C); /* XXX temp? prevent changes during render */ - if (G.rendering) return 0; + if (G.is_rendering) return 0; /* as long as there is an active area, and it isn't a Graph Editor * (since the Graph Editor has its own version which does extra stuff), diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 2620fc46e74..9207a6ff3b8 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2562,7 +2562,7 @@ static void do_running_jobs(bContext *C, void *UNUSED(arg), int event) { switch (event) { case B_STOPRENDER: - G.afbreek = 1; + G.is_break = TRUE; break; case B_STOPCAST: WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C), NULL); diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index e1c715952d1..2e28db8ad8e 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -358,7 +358,7 @@ static int multiresbake_test_break(MultiresBakeRender *bkr) return 0; } - return G.afbreek; + return G.is_break; } static void do_multires_bake(MultiresBakeRender *bkr, Image *ima, MPassKnownData passKnownData, @@ -1260,7 +1260,7 @@ static int multiresbake_image_exec(bContext *C, wmOperator *op) WM_jobs_timer(steve, 0.2, NC_IMAGE, 0); /* TODO - only draw bake image, can we enforce this */ WM_jobs_callbacks(steve, multiresbake_startjob, NULL, NULL, NULL); - G.afbreek = 0; + G.is_break = FALSE; WM_jobs_start(CTX_wm_manager(C), steve); WM_cursor_wait(0); @@ -1276,7 +1276,7 @@ static int multiresbake_image_exec(bContext *C, wmOperator *op) /* threaded break test */ static int thread_break(void *UNUSED(arg)) { - return G.afbreek; + return G.is_break; } typedef struct BakeRender { @@ -1401,7 +1401,7 @@ static void bake_startjob(void *bkv, short *stop, short *do_update, float *progr bkr->progress = progress; RE_test_break_cb(bkr->re, NULL, thread_break); - G.afbreek = 0; /* blender_test_break uses this global */ + G.is_break = FALSE; /* blender_test_break uses this global */ RE_Database_Baking(bkr->re, bmain, scene, scene->lay, scene->r.bake_mode, bkr->actob); @@ -1431,7 +1431,7 @@ static void bake_freejob(void *bkv) BKE_report(bkr->reports, RPT_WARNING, "Feedback loop detected"); MEM_freeN(bkr); - G.rendering = 0; + G.is_rendering = FALSE; } /* catch esc */ @@ -1487,8 +1487,8 @@ static int objects_bake_render_invoke(bContext *C, wmOperator *op, wmEvent *UNUS WM_jobs_timer(steve, 0.2, NC_IMAGE, 0); /* TODO - only draw bake image, can we enforce this */ WM_jobs_callbacks(steve, bake_startjob, NULL, bake_update, NULL); - G.afbreek = 0; - G.rendering = 1; + G.is_break = FALSE; + G.is_rendering = TRUE; WM_jobs_start(CTX_wm_manager(C), steve); @@ -1528,7 +1528,7 @@ static int bake_image_exec(bContext *C, wmOperator *op) bkr.reports = op->reports; RE_test_break_cb(bkr.re, NULL, thread_break); - G.afbreek = 0; /* blender_test_break uses this global */ + G.is_break = FALSE; /* blender_test_break uses this global */ RE_Database_Baking(bkr.re, bmain, scene, scene->lay, scene->r.bake_mode, (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT : NULL); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 1b18bfe193a..b47269097fb 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -2060,7 +2060,7 @@ static int oceanbake_breakjob(void *UNUSED(customdata)) /* this is not nice yet, need to make the jobs list template better * for identifying/acting upon various different jobs */ /* but for now we'll reuse the render break... */ - return (G.afbreek); + return (G.is_break); } /* called by oceanbake, wmJob sends notifier */ @@ -2083,7 +2083,7 @@ static void oceanbake_startjob(void *customdata, short *stop, short *do_update, oj->do_update = do_update; oj->progress = progress; - G.afbreek = 0; /* XXX shared with render - replace with job 'stop' switch */ + G.is_break = FALSE; /* XXX shared with render - replace with job 'stop' switch */ BKE_bake_ocean(oj->ocean, oj->och, oceanbake_update, (void *)oj); diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c index ea8718f0e66..bc09df734a6 100644 --- a/source/blender/editors/physics/dynamicpaint_ops.c +++ b/source/blender/editors/physics/dynamicpaint_ops.c @@ -369,7 +369,7 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op) /* Set state to baking and init surface */ canvas->error[0] = '\0'; canvas->flags |= MOD_DPAINT_BAKING; - G.afbreek= 0; /* reset blender_test_break*/ + G.is_break = FALSE; /* reset blender_test_break*/ /* Bake Dynamic Paint */ status = dynamicPaint_bakeImageSequence(C, surface, ob); diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index dc2f70189e7..1c4a4314d45 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -745,7 +745,7 @@ static int fluidbake_breakjob(void *customdata) /* this is not nice yet, need to make the jobs list template better * for identifying/acting upon various different jobs */ /* but for now we'll reuse the render break... */ - return (G.afbreek); + return (G.is_break); } /* called by fluidbake, wmJob sends notifier */ @@ -765,7 +765,7 @@ static void fluidbake_startjob(void *customdata, short *stop, short *do_update, fb->do_update = do_update; fb->progress = progress; - G.afbreek= 0; /* XXX shared with render - replace with job 'stop' switch */ + G.is_break = FALSE; /* XXX shared with render - replace with job 'stop' switch */ elbeemSimulate(); *do_update = TRUE; diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index c935cb7da82..6e772f66a6a 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -61,7 +61,7 @@ static int cache_break_test(void *UNUSED(cbd)) { - return G.afbreek==1; + return (G.is_break == TRUE); } static int ptcache_bake_all_poll(bContext *C) { diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 9716b6d8a81..8a61af61239 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -213,7 +213,7 @@ static int screen_render_exec(bContext *C, wmOperator *op) re = RE_NewRender(scene->id.name); lay = (v3d) ? v3d->lay : scene->lay; - G.afbreek = 0; + G.is_break = FALSE; RE_test_break_cb(re, NULL, (int (*)(void *))blender_test_break); ima = BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"); @@ -427,7 +427,7 @@ static void render_endjob(void *rjv) } /* XXX render stability hack */ - G.rendering = 0; + G.is_rendering = FALSE; WM_main_add_notifier(NC_WINDOW, NULL); } @@ -436,7 +436,7 @@ static int render_breakjob(void *rjv) { RenderJob *rj = rjv; - if (G.afbreek) + if (G.is_break) return 1; if (rj->stop && *(rj->stop)) return 1; @@ -584,7 +584,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) RE_progress_cb(re, rj, render_progress_update); rj->re = re; - G.afbreek = 0; + G.is_break = FALSE; /* store actual owner of job, so modal operator could check for it, * the reason of this is that active scene could change when rendering @@ -597,10 +597,10 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) WM_cursor_wait(0); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_RESULT, scene); - /* we set G.rendering here already instead of only in the job, this ensure + /* we set G.is_rendering here already instead of only in the job, this ensure * main loop or other scene updates are disabled in time, since they may * have started before the job thread */ - G.rendering = 1; + G.is_rendering = TRUE; /* add modal handler for ESC */ WM_event_add_modal_handler(C, op); diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 29ebc51df3e..c7f48154970 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -683,7 +683,7 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs if (ELEM(sp->pr_method, PR_BUTS_RENDER, PR_NODE_RENDER)) { RE_display_draw_cb(re, sp, shader_preview_draw); } - /* set this for all previews, default is react to G.afbreek still */ + /* set this for all previews, default is react to G.is_break still */ RE_test_break_cb(re, sp, shader_preview_break); /* lens adjust */ diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c index 0d902722183..01c0169eb50 100644 --- a/source/blender/editors/render/render_view.c +++ b/source/blender/editors/render/render_view.c @@ -297,7 +297,7 @@ static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent /* determine if render already shows */ if (sa) { /* but don't close it when rendering */ - if (!G.rendering) { + if (G.is_rendering == FALSE) { SpaceImage *sima = sa->spacedata.first; if (sima->flag & SI_PREVSPACE) { diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 36353c43cbd..aa49389db72 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -119,7 +119,7 @@ int ED_operator_screenactive(bContext *C) /* XXX added this to prevent anim state to change during renders */ static int ED_operator_screenactive_norender(bContext *C) { - if (G.rendering) return 0; + if (G.is_rendering) return 0; if (CTX_wm_window(C) == NULL) return 0; if (CTX_wm_screen(C) == NULL) return 0; return 1; diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index e211b61aede..2313b176073 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -803,7 +803,7 @@ void CLIP_OT_view_selected(wmOperatorType *ot) static int change_frame_poll(bContext *C) { /* prevent changes during render */ - if (G.rendering) + if (G.is_rendering) return 0; return ED_space_clip_poll(C); @@ -1000,7 +1000,7 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, distortion, cfra, build_undistort_sizes, build_undistort_count, 1); - if (*stop || G.afbreek) + if (*stop || G.is_break) break; *do_update = TRUE; @@ -1058,7 +1058,7 @@ static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) WM_jobs_timer(steve, 0.2, NC_MOVIECLIP | ND_DISPLAY, 0); WM_jobs_callbacks(steve, proxy_startjob, NULL, NULL, proxy_endjob); - G.afbreek = 0; + G.is_break = FALSE; WM_jobs_start(CTX_wm_manager(C), steve); ED_area_tag_redraw(CTX_wm_area(C)); diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 153287eecdd..4283c6f77c7 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -952,7 +952,7 @@ typedef struct TrackMarkersJob { static int track_markers_testbreak(void) { - return G.afbreek; + return G.is_break; } static int track_count_markers(SpaceClip *sc, MovieClip *clip) @@ -1275,7 +1275,7 @@ static int track_markers_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve WM_jobs_callbacks(steve, track_markers_startjob, NULL, track_markers_updatejob, NULL); - G.afbreek = 0; + G.is_break = FALSE; WM_jobs_start(CTX_wm_manager(C), steve); WM_cursor_wait(0); @@ -1497,7 +1497,7 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even WM_jobs_timer(steve, 0.1, NC_MOVIECLIP | NA_EVALUATED, 0); WM_jobs_callbacks(steve, solve_camera_startjob, NULL, solve_camera_updatejob, NULL); - G.afbreek = 0; + G.is_break = FALSE; WM_jobs_start(CTX_wm_manager(C), steve); WM_cursor_wait(0); diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index a736cc4cb73..51bd4e16d06 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -238,7 +238,7 @@ void image_preview_event(int event) ntreeCompositTagGenerators(G.scene->nodetree); - G.afbreek = 0; + G.is_break = FALSE; G.scene->nodetree->timecursor = set_timecursor; G.scene->nodetree->test_break = blender_test_break; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index dd8ad318cbd..11f070b483d 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -177,7 +177,7 @@ void ED_node_composite_job(const bContext *C, struct bNodeTree *nodetree, Scene CompoJob *cj; /* to fix bug: [#32272] */ - if (G.rendering) { + if (G.is_rendering) { return; } diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index dc19dfc419d..297aeb465a6 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -849,7 +849,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq UI_view2d_curRect_validate(v2d); /* only initialize the preview if a render is in progress */ - if (G.rendering) + if (G.is_rendering) return; context = BKE_sequencer_new_render_data(bmain, scene, rectx, recty, proxy_size); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 758edcf2b2e..7cc6e279ff2 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -212,7 +212,7 @@ static void seq_proxy_build_job(const bContext *C) SEQ_END if (!WM_jobs_is_running(steve)) { - G.afbreek = 0; + G.is_break = FALSE; WM_jobs_start(CTX_wm_manager(C), steve); } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 244588f10c5..3803ac6593a 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -6581,7 +6581,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short } /* XXX particles are not safe for simultaneous threaded render */ - if (G.rendering && ob->particlesystem.first) + if (G.is_rendering && ob->particlesystem.first) return; /* xray delay? */ |