diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-01 04:34:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-01 08:22:28 +0400 |
commit | 617557b08ea94e2b65a1697ddf0b79651204d92b (patch) | |
tree | 50b24bab075b42fa20456140c9a9681cfb01325b /source/blender/editors/render | |
parent | 2c00ecc738c04dc5dc22d4a6b81a1e937526ba6d (diff) |
Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 24 | ||||
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 16 | ||||
-rw-r--r-- | source/blender/editors/render/render_preview.c | 36 | ||||
-rw-r--r-- | source/blender/editors/render/render_shading.c | 12 | ||||
-rw-r--r-- | source/blender/editors/render/render_update.c | 20 | ||||
-rw-r--r-- | source/blender/editors/render/render_view.c | 2 |
6 files changed, 56 insertions, 54 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 9531c7793d3..064f6ca3d1e 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -104,7 +104,7 @@ typedef struct RenderJob { struct Object *camera_override; int lay_override; bool v3d_override; - short anim, write_still; + bool anim, write_still; Image *image; ImageUser iuser; bool image_outdated; @@ -304,7 +304,7 @@ static int screen_render_exec(bContext *C, wmOperator *op) re = RE_NewRender(scene->id.name); lay_override = (v3d && v3d->lay != scene->lay) ? v3d->lay : 0; - G.is_break = FALSE; + G.is_break = false; RE_test_break_cb(re, NULL, render_break); ima = BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"); @@ -444,7 +444,7 @@ static void image_renderinfo_cb(void *rjv, RenderStats *rs) RE_ReleaseResult(rj->re); /* make jobs timer to send notifier */ - *(rj->do_update) = TRUE; + *(rj->do_update) = true; } @@ -456,7 +456,7 @@ static void render_progress_update(void *rjv, float progress) *rj->progress = progress; /* make jobs timer to send notifier */ - *(rj->do_update) = TRUE; + *(rj->do_update) = true; } } @@ -534,7 +534,7 @@ static void image_rect_update(void *rjv, RenderResult *rr, volatile rcti *renrec /* update entire render */ rj->image_outdated = false; BKE_image_signal(ima, NULL, IMA_SIGNAL_COLORMANAGE); - *(rj->do_update) = TRUE; + *(rj->do_update) = true; return; } @@ -560,7 +560,7 @@ static void image_rect_update(void *rjv, RenderResult *rr, volatile rcti *renrec } /* make jobs timer to send notifier */ - *(rj->do_update) = TRUE; + *(rj->do_update) = true; } BKE_image_release_ibuf(ima, ibuf, lock); } @@ -640,7 +640,7 @@ static void render_endjob(void *rjv) } /* XXX render stability hack */ - G.is_rendering = FALSE; + G.is_rendering = false; WM_main_add_notifier(NC_SCENE | ND_RENDER_RESULT, NULL); /* Partial render result will always update display buffer @@ -945,7 +945,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even RE_progress_cb(re, rj, render_progress_update); rj->re = re; - G.is_break = FALSE; + 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 @@ -961,7 +961,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even /* 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.is_rendering = TRUE; + G.is_rendering = true; /* add modal handler for ESC */ WM_event_add_modal_handler(C, op); @@ -1095,7 +1095,7 @@ static void render_view3d_display_update(void *rpv, RenderResult *UNUSED(rr), vo { RenderPreview *rp = rpv; - *(rp->do_update) = TRUE; + *(rp->do_update) = true; } static void render_view3d_renderinfo_cb(void *rjp, RenderStats *rs) @@ -1110,7 +1110,7 @@ static void render_view3d_renderinfo_cb(void *rjp, RenderStats *rs) make_renderinfo_string(rs, rp->scene, false, rp->engine->text); /* make jobs timer to send notifier */ - *(rp->do_update) = TRUE; + *(rp->do_update) = true; } } @@ -1133,7 +1133,7 @@ static void render_view3d_startjob(void *customdata, short *stop, short *do_upda //printf("ma %d res %d view %d db %d\n", update_flag & PR_UPDATE_MATERIAL, update_flag & PR_UPDATE_RENDERSIZE, update_flag & PR_UPDATE_VIEW, update_flag & PR_UPDATE_DATABASE); - G.is_break = FALSE; + G.is_break = false; if (false == render_view3d_get_rects(rp->ar, rp->v3d, rp->rv3d, &viewplane, rp->engine, &clipsta, &clipend, &pixsize, &orth)) return; diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index dba44bacd03..242ba1f1d67 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -247,7 +247,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender) /* shouldnt suddenly give errors mid-render but possible */ char err_out[256] = "unknown"; ImBuf *ibuf_view = ED_view3d_draw_offscreen_imbuf_simple(scene, scene->camera, oglrender->sizex, oglrender->sizey, - IB_rect, OB_SOLID, FALSE, TRUE, + IB_rect, OB_SOLID, false, true, (draw_sky) ? R_ADDSKY : R_ALPHAPREMUL, err_out); camera = scene->camera; @@ -308,8 +308,9 @@ static void screen_opengl_render_apply(OGLRender *oglrender) IMB_color_to_bw(ibuf); } - BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, &scene->r.im_format, scene->r.scemode & R_EXTENSION, FALSE); - ok = BKE_imbuf_write_as(ibuf, name, &scene->r.im_format, TRUE); /* no need to stamp here */ + BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, + &scene->r.im_format, (scene->r.scemode & R_EXTENSION) != 0, false); + ok = BKE_imbuf_write_as(ibuf, name, &scene->r.im_format, true); /* no need to stamp here */ if (ok) printf("OpenGL Render written to '%s'\n", name); else printf("OpenGL Render failed to write '%s'\n", name); } @@ -348,7 +349,7 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) /* ensure we have a 3d view */ if (!ED_view3d_context_activate(C)) { - RNA_boolean_set(op->ptr, "view_context", FALSE); + RNA_boolean_set(op->ptr, "view_context", false); is_view_context = false; } @@ -532,7 +533,8 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) is_movie = BKE_imtype_is_movie(scene->r.im_format.imtype); if (!is_movie) { - BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, &scene->r.im_format, scene->r.scemode & R_EXTENSION, TRUE); + BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, + &scene->r.im_format, (scene->r.scemode & R_EXTENSION) != 0, true); if ((scene->r.mode & R_NO_OVERWRITE) && BLI_exists(name)) { BKE_reportf(op->reports, RPT_INFO, "Skipping existing frame \"%s\"", name); @@ -569,7 +571,7 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) ibuf = BKE_image_acquire_ibuf(oglrender->ima, &oglrender->iuser, &lock); if (ibuf) { - int needs_free = FALSE; + bool needs_free = false; ibuf_save = ibuf; @@ -577,7 +579,7 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) ibuf_save = IMB_colormanagement_imbuf_for_write(ibuf, true, true, &scene->view_settings, &scene->display_settings, &scene->r.im_format); - needs_free = TRUE; + needs_free = true; } /* color -> grayscale */ diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 482c855f067..fdb9b5c04ed 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -392,8 +392,8 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre sce->lay = 1 << mat->pr_type; if (mat->nodetree && sp->pr_method == PR_NODE_RENDER) { /* two previews, they get copied by wmJob */ - BKE_node_preview_init_tree(mat->nodetree, sp->sizex, sp->sizey, TRUE); - BKE_node_preview_init_tree(origmat->nodetree, sp->sizex, sp->sizey, TRUE); + BKE_node_preview_init_tree(mat->nodetree, sp->sizex, sp->sizey, true); + BKE_node_preview_init_tree(origmat->nodetree, sp->sizex, sp->sizey, true); } } } @@ -456,8 +456,8 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre if (tex && tex->nodetree && sp->pr_method == PR_NODE_RENDER) { /* two previews, they get copied by wmJob */ - BKE_node_preview_init_tree(origtex->nodetree, sp->sizex, sp->sizey, TRUE); - BKE_node_preview_init_tree(tex->nodetree, sp->sizex, sp->sizey, TRUE); + BKE_node_preview_init_tree(origtex->nodetree, sp->sizex, sp->sizey, true); + BKE_node_preview_init_tree(tex->nodetree, sp->sizex, sp->sizey, true); } } else if (id_type == ID_LA) { @@ -493,8 +493,8 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre if (la && la->nodetree && sp->pr_method == PR_NODE_RENDER) { /* two previews, they get copied by wmJob */ - BKE_node_preview_init_tree(origla->nodetree, sp->sizex, sp->sizey, TRUE); - BKE_node_preview_init_tree(la->nodetree, sp->sizex, sp->sizey, TRUE); + BKE_node_preview_init_tree(origla->nodetree, sp->sizex, sp->sizey, true); + BKE_node_preview_init_tree(la->nodetree, sp->sizex, sp->sizey, true); } } else if (id_type == ID_WO) { @@ -511,8 +511,8 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre if (wrld && wrld->nodetree && sp->pr_method == PR_NODE_RENDER) { /* two previews, they get copied by wmJob */ - BKE_node_preview_init_tree(wrld->nodetree, sp->sizex, sp->sizey, TRUE); - BKE_node_preview_init_tree(origwrld->nodetree, sp->sizex, sp->sizey, TRUE); + BKE_node_preview_init_tree(wrld->nodetree, sp->sizex, sp->sizey, true); + BKE_node_preview_init_tree(origwrld->nodetree, sp->sizex, sp->sizey, true); } } @@ -629,7 +629,7 @@ static void shader_preview_update(void *spv, RenderResult *UNUSED(rr), volatile { ShaderPreview *sp = spv; - *(sp->do_update) = TRUE; + *(sp->do_update) = true; } /* called by renderer, checks job value */ @@ -790,7 +790,7 @@ static void shader_preview_startjob(void *customdata, short *stop, short *do_upd else shader_preview_render(sp, sp->id, 0, 0); - *do_update = TRUE; + *do_update = true; } static void shader_preview_free(void *customdata) @@ -807,9 +807,9 @@ static void shader_preview_free(void *customdata) /* get rid of copied material */ BLI_remlink(&pr_main->mat, sp->matcopy); - BKE_material_free_ex(sp->matcopy, FALSE); + BKE_material_free_ex(sp->matcopy, false); - properties = IDP_GetProperties((ID *)sp->matcopy, FALSE); + properties = IDP_GetProperties((ID *)sp->matcopy, false); if (properties) { IDP_FreeProperty(properties); MEM_freeN(properties); @@ -825,7 +825,7 @@ static void shader_preview_free(void *customdata) BLI_remlink(&pr_main->tex, sp->texcopy); BKE_texture_free(sp->texcopy); - properties = IDP_GetProperties((ID *)sp->texcopy, FALSE); + properties = IDP_GetProperties((ID *)sp->texcopy, false); if (properties) { IDP_FreeProperty(properties); MEM_freeN(properties); @@ -839,9 +839,9 @@ static void shader_preview_free(void *customdata) /* get rid of copied world */ BLI_remlink(&pr_main->world, sp->worldcopy); - BKE_world_free_ex(sp->worldcopy, TRUE); /* [#32865] - we need to unlink the texture copies, unlike for materials */ + BKE_world_free_ex(sp->worldcopy, true); /* [#32865] - we need to unlink the texture copies, unlike for materials */ - properties = IDP_GetProperties((ID *)sp->worldcopy, FALSE); + properties = IDP_GetProperties((ID *)sp->worldcopy, false); if (properties) { IDP_FreeProperty(properties); MEM_freeN(properties); @@ -857,7 +857,7 @@ static void shader_preview_free(void *customdata) BLI_remlink(&pr_main->lamp, sp->lampcopy); BKE_lamp_free(sp->lampcopy); - properties = IDP_GetProperties((ID *)sp->lampcopy, FALSE); + properties = IDP_GetProperties((ID *)sp->lampcopy, false); if (properties) { IDP_FreeProperty(properties); MEM_freeN(properties); @@ -959,7 +959,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat icon_copy_rect(ibuf, sp->sizex, sp->sizey, sp->pr_rect); - *do_update = TRUE; + *do_update = true; BKE_image_release_ibuf(ima, ibuf, NULL); } @@ -975,7 +975,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat icon_copy_rect(br->icon_imbuf, sp->sizex, sp->sizey, sp->pr_rect); - *do_update = TRUE; + *do_update = true; } else { /* re-use shader job */ diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index c691c2ca0b2..3906b3d0c10 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -229,7 +229,7 @@ void OBJECT_OT_material_slot_assign(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; } -static int material_slot_de_select(bContext *C, int select) +static int material_slot_de_select(bContext *C, bool select) { Object *ob = ED_object_context(C); @@ -295,7 +295,7 @@ static int material_slot_de_select(bContext *C, int select) static int material_slot_select_exec(bContext *C, wmOperator *UNUSED(op)) { - return material_slot_de_select(C, 1); + return material_slot_de_select(C, true); } void OBJECT_OT_material_slot_select(wmOperatorType *ot) @@ -314,7 +314,7 @@ void OBJECT_OT_material_slot_select(wmOperatorType *ot) static int material_slot_deselect_exec(bContext *C, wmOperator *UNUSED(op)) { - return material_slot_de_select(C, 0); + return material_slot_de_select(C, false); } void OBJECT_OT_material_slot_deselect(wmOperatorType *ot) @@ -392,7 +392,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op)) if (BKE_scene_use_new_shading_nodes(scene)) { ED_node_shader_default(C, &ma->id); - ma->use_nodes = TRUE; + ma->use_nodes = true; } } @@ -496,7 +496,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op)) if (BKE_scene_use_new_shading_nodes(scene)) { ED_node_shader_default(C, &wo->id); - wo->use_nodes = TRUE; + wo->use_nodes = true; } } @@ -743,7 +743,7 @@ static int freestyle_active_lineset_poll(bContext *C) SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay); if (!srl) { - return FALSE; + return false; } return BKE_freestyle_lineset_get_active(&srl->freestyleConfig) != NULL; diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index 5f74bf6576a..81eb11d7138 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -81,7 +81,7 @@ void ED_render_scene_update(Main *bmain, Scene *scene, int updated) bContext *C; wmWindowManager *wm; wmWindow *win; - static int recursive_check = FALSE; + static bool recursive_check = false; /* don't do this render engine update if we're updating the scene from * other threads doing e.g. rendering or baking jobs */ @@ -92,7 +92,7 @@ void ED_render_scene_update(Main *bmain, Scene *scene, int updated) if (recursive_check) return; - recursive_check = TRUE; + recursive_check = true; C = CTX_create(); CTX_data_main_set(C, bmain); @@ -140,7 +140,7 @@ void ED_render_scene_update(Main *bmain, Scene *scene, int updated) CTX_free(C); - recursive_check = FALSE; + recursive_check = false; } void ED_render_engine_area_exit(ScrArea *sa) @@ -275,7 +275,7 @@ static void material_changed(Main *bmain, Material *ma) Material *parent; Object *ob; Scene *scene; - int texture_draw = FALSE; + int texture_draw = false; /* icons */ BKE_icon_changed(BKE_icon_getid(&ma->id)); @@ -302,7 +302,7 @@ static void material_changed(Main *bmain, Material *ma) /* find if we have a scene with textured display */ for (scene = bmain->scene.first; scene; scene = scene->id.next) { if (scene->customdata_mask & CD_MASK_MTFACE) { - texture_draw = TRUE; + texture_draw = true; break; } } @@ -351,11 +351,11 @@ static void lamp_changed(Main *bmain, Lamp *la) static int material_uses_texture(Material *ma, Tex *tex) { if (mtex_use_tex(ma->mtex, MAX_MTEX, tex)) - return TRUE; + return true; else if (ma->use_nodes && ma->nodetree && nodes_use_tex(ma->nodetree, tex)) - return TRUE; + return true; - return FALSE; + return false; } static void texture_changed(Main *bmain, Tex *tex) @@ -366,7 +366,7 @@ static void texture_changed(Main *bmain, Tex *tex) Scene *scene; Object *ob; bNode *node; - int texture_draw = FALSE; + int texture_draw = false; /* icons */ BKE_icon_changed(BKE_icon_getid(&tex->id)); @@ -424,7 +424,7 @@ static void texture_changed(Main *bmain, Tex *tex) } if (scene->customdata_mask & CD_MASK_MTFACE) - texture_draw = TRUE; + texture_draw = true; } /* find textured objects */ diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c index c1cd17465cf..80ce74f3c5b 100644 --- a/source/blender/editors/render/render_view.c +++ b/source/blender/editors/render/render_view.c @@ -305,7 +305,7 @@ static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(op), const wm /* determine if render already shows */ if (sa) { /* but don't close it when rendering */ - if (G.is_rendering == FALSE) { + if (G.is_rendering == false) { SpaceImage *sima = sa->spacedata.first; if (sima->flag & SI_PREVSPACE) { |