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/editors/space_view3d | |
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/editors/space_view3d')
6 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 2211b1ddb62..6a070070379 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1667,7 +1667,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, GLfloat tmp; float smat[4][4], imat[4][4], bmat[4][4]; int index = -1; - short do_dashed = 3, draw_wire = 0; + short do_dashed = 3, draw_wire = FALSE; int flag; /* being set below */ diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index b5c44fd1a8c..de1d9f22667 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -233,7 +233,7 @@ static Material *give_current_material_or_def(Object *ob, int matnr) static struct TextureDrawState { Object *ob; - int islit, istex; + int is_lit, is_tex; int color_profile; unsigned char obcol[4]; } Gtexdraw = {NULL, 0, 0, 0, {0, 0, 0, 0}}; @@ -263,12 +263,12 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m c_has_texface = -1; } else { - textured = gtexdraw.istex; + textured = gtexdraw.is_tex; litob = gtexdraw.ob; } /* convert number of lights into boolean */ - if (gtexdraw.islit) lit = 1; + if (gtexdraw.is_lit) lit = 1; if (ma) { alphablend = ma->game.alpha_blend; @@ -343,7 +343,7 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob) { unsigned char obcol[4]; - int istex, solidtex; + int is_tex, solidtex; // XXX scene->obedit warning @@ -351,27 +351,27 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O * with face selection in weight paint is not lit. */ if ((v3d->drawtype <= OB_WIRE) && (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT))) { solidtex = FALSE; - Gtexdraw.islit = 0; + Gtexdraw.is_lit = 0; } else if (v3d->drawtype == OB_SOLID || ((ob->mode & OB_MODE_EDIT) && v3d->drawtype != OB_TEXTURE)) { /* draw with default lights in solid draw mode and edit mode */ solidtex = TRUE; - Gtexdraw.islit = -1; + Gtexdraw.is_lit = -1; } else { /* draw with lights in the scene otherwise */ solidtex = FALSE; - Gtexdraw.islit = GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp); + Gtexdraw.is_lit = GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp); } rgba_float_to_uchar(obcol, ob->col); glCullFace(GL_BACK); glEnable(GL_CULL_FACE); - if (solidtex || v3d->drawtype == OB_TEXTURE) istex = 1; - else istex = 0; + if (solidtex || v3d->drawtype == OB_TEXTURE) is_tex = 1; + else is_tex = 0; Gtexdraw.ob = ob; - Gtexdraw.istex = istex; + Gtexdraw.is_tex = is_tex; Gtexdraw.color_profile = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT; memcpy(Gtexdraw.obcol, obcol, sizeof(obcol)); set_draw_settings_cached(1, NULL, NULL, Gtexdraw); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 00622f368f0..e69538345bb 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1967,7 +1967,7 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob) Lattice *lt = ob->data; DispList *dl; int u, v, w; - int use_wcol = 0, is_edit = (lt->editlatt != NULL); + int use_wcol = FALSE, is_edit = (lt->editlatt != NULL); /* now we default make displist, this will modifiers work for non animated case */ if (ob->disp.first == NULL) @@ -3543,7 +3543,7 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D Object *obedit = scene->obedit; Mesh *me = ob->data; BMEditMesh *em = me->edit_btmesh; - int do_alpha_after = 0, drawlinked = 0, retval = 0, glsl, check_alpha, i; + int do_alpha_after = FALSE, drawlinked = 0, retval = 0, glsl, check_alpha, i; /* If we are drawing shadows and any of the materials don't cast a shadow, * then don't draw the object */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index d9126b3809a..f18ba29b1f4 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1848,7 +1848,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas /* generate displist, test for new object */ if (dob_prev && dob_prev->ob != dob->ob) { - if (use_displist == 1) + if (use_displist == TRUE) glDeleteLists(displist, 1); use_displist = -1; @@ -1870,7 +1870,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas !(bb_tmp = BKE_object_boundbox_get(dob->ob))) { // printf("draw_dupli_objects_color: skipping displist for %s\n", dob->ob->id.name+2); - use_displist = 0; + use_displist = FALSE; } else { // printf("draw_dupli_objects_color: using displist for %s\n", dob->ob->id.name+2); @@ -1886,7 +1886,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas draw_object(scene, ar, v3d, &tbase, DRAW_CONSTCOLOR); glEndList(); - use_displist = 1; + use_displist = TRUE; BKE_object_boundbox_flag(dob->ob, OB_BB_DISABLED, 0); } } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 4bfb6dd9fd6..8ba0d75c786 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2051,7 +2051,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in int center = RNA_boolean_get(op->ptr, "center"); float size, min[3], max[3], afm[3]; - int ok = 1, onedone = 0; + int ok = 1, onedone = FALSE; if (center) { /* in 2.4x this also move the cursor to (0, 0, 0) (with shift+c). */ @@ -2066,7 +2066,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in for (base = scene->base.first; base; base = base->next) { if (BASE_VISIBLE(v3d, base)) { - onedone = 1; + onedone = TRUE; if (skip_camera && base->object == v3d->camera) { continue; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 583736716c6..0bbd03c10bb 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -405,7 +405,7 @@ static void do_lasso_select_mesh__doSelectEdge(void *userData, BMEdge *eed, int BLI_lasso_is_point_inside(data->mcords, data->moves, x1, y1, IS_CLIPPED)) { BM_edge_select_set(data->vc->em->bm, eed, data->select); - data->done = 1; + data->done = TRUE; } } else { @@ -443,7 +443,7 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves, data.mcords = mcords; data.moves = moves; data.select = select; - data.done = 0; + data.done = FALSE; data.pass = 0; if (extend == 0 && select) @@ -1180,19 +1180,19 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int View3D *v3d = vc->v3d; Base *base, *basact = NULL; static int lastmval[2] = {-100, -100}; - int a, donearest = 0; + int a, do_nearest = FALSE; /* define if we use solid nearest select or not */ if (v3d->drawtype > OB_WIRE) { - donearest = 1; + do_nearest = TRUE; if (ABS(mval[0] - lastmval[0]) < 3 && ABS(mval[1] - lastmval[1]) < 3) { if (!has_bones) /* hrms, if theres bones we always do nearest */ - donearest = 0; + do_nearest = FALSE; } } lastmval[0] = mval[0]; lastmval[1] = mval[1]; - if (donearest) { + if (do_nearest) { unsigned int min = 0xFFFFFFFF; int selcol = 0, notcol = 0; @@ -1623,7 +1623,7 @@ static void do_mesh_box_select__doSelectEdge(void *userData, BMEdge *eed, int x0 if (data->pass == 0) { if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1)) { BM_edge_select_set(data->vc->em->bm, eed, data->select); - data->done = 1; + data->done = TRUE; } } else { @@ -1651,7 +1651,7 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten data.rect = rect; data.select = select; data.pass = 0; - data.done = 0; + data.done = FALSE; if (extend == 0 && select) EDBM_flag_disable_all(vc->em, BM_ELEM_SELECT); |