Merged changes in the trunk up to revision 46045.
[blender-staging.git] / source / blender / editors / space_view3d / drawobject.c
index 8a4d2f86a9c3345683e481b00dd4dc072c74f529..4c714b936183772511bb104399507dc59961c3ec 100644 (file)
@@ -182,11 +182,11 @@ static void draw_empty_cone(float size);
 static int check_object_draw_texture(Scene *scene, View3D *v3d, int drawtype)
 {
        /* texture and material draw modes */
-    if(ELEM(v3d->drawtype, OB_TEXTURE, OB_MATERIAL) && drawtype > OB_SOLID)
+       if (ELEM(v3d->drawtype, OB_TEXTURE, OB_MATERIAL) && drawtype > OB_SOLID)
                return TRUE;
 
        /* textured solid */
-       if(v3d->drawtype == OB_SOLID && (v3d->flag2 & V3D_SOLID_TEX) && !scene_use_new_shading_nodes(scene))
+       if (v3d->drawtype == OB_SOLID && (v3d->flag2 & V3D_SOLID_TEX) && !scene_use_new_shading_nodes(scene))
                return TRUE;
        
        return FALSE;
@@ -2213,7 +2213,7 @@ void nurbs_foreachScreenVert(
        short s[2] = {IS_CLIPPED, 0};
        Nurb *nu;
        int i;
-       ListBase *nurbs = curve_editnurbs(cu);
+       ListBase *nurbs = BKE_curve_editNurbs_get(cu);
 
        ED_view3d_clipping_local(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
 
@@ -2861,7 +2861,7 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS
        }
 
        if (me->drawflag & ME_DRAWEXTRA_FACEAREA) {
-               /* would be nice to use BM_face_area_calc, but that is for 2d faces
+               /* would be nice to use BM_face_calc_area, but that is for 2d faces
                 * so instead add up tessellation triangle areas */
                BMFace *f;
                int n;
@@ -2926,7 +2926,7 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS
                        BMIter liter;
                        BMLoop *loop;
 
-                       BM_face_center_bounds_calc(efa, vmid);
+                       BM_face_calc_center_bounds(efa, vmid);
 
                        for (loop = BM_iter_new(&liter, em->bm, BM_LOOPS_OF_FACE, efa);
                             loop; loop = BM_iter_step(&liter))
@@ -3000,7 +3000,7 @@ static void draw_em_indices(BMEditMesh *em)
                UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col);
                BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
                        if (BM_elem_flag_test(f, BM_ELEM_SELECT)) {
-                               BM_face_center_mean_calc(f, pos);
+                               BM_face_calc_center_mean(f, pos);
                                sprintf(numstr, "%d", i);
                                view3d_cached_text_draw_add(pos, numstr, 0, txt_flag, col);
                        }
@@ -3336,7 +3336,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
                }
        }
        else if (dt == OB_SOLID) {
-               if (is_obact && ob->mode & OB_MODE_WEIGHT_PAINT) {
+               if (is_obact && ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) {
                        /* weight paint in solid mode, special case. focus on making the weights clear
                         * rather than the shading, this is also forced in wire view */
                        GPU_enable_material(0, NULL);
@@ -3993,7 +3993,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
                        break;
                case OB_MBALL:
 
-                       if (is_basis_mball(ob)) {
+                       if (BKE_metaball_is_basis(ob)) {
                                lb = &ob->disp;
                                if (lb->first == NULL) makeDispListMBall(scene, ob);
                                if (lb->first == NULL) return 1;
@@ -4371,8 +4371,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
                normalize_v3(imat[1]);
        }
 
-       if (ELEM3(draw_as, PART_DRAW_DOT, PART_DRAW_CROSS, PART_DRAW_LINE)
-           && part->draw_col > PART_DRAW_COL_MAT)
+       if (ELEM3(draw_as, PART_DRAW_DOT, PART_DRAW_CROSS, PART_DRAW_LINE) &&
+           (part->draw_col > PART_DRAW_COL_MAT))
        {
                create_cdata = 1;
        }
@@ -6170,7 +6170,7 @@ static void draw_bounding_volume(Scene *scene, Object *ob, char type)
                bb = ob->bb ? ob->bb : ( (Curve *)ob->data)->bb;
        }
        else if (ob->type == OB_MBALL) {
-               if (is_basis_mball(ob)) {
+               if (BKE_metaball_is_basis(ob)) {
                        bb = ob->bb;
                        if (bb == NULL) {
                                makeDispListMBall(scene, ob);
@@ -6261,7 +6261,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
                }
        }
        else if (ob->type == OB_MBALL) {
-               if (is_basis_mball(ob)) {
+               if (BKE_metaball_is_basis(ob)) {
                        if ((base->flag & OB_FROMDUPLI) == 0)
                                drawDispListwire(&ob->disp);
                }
@@ -6321,7 +6321,7 @@ static void drawWireExtra(Scene *scene, RegionView3D *rv3d, Object *ob)
                }
        }
        else if (ob->type == OB_MBALL) {
-               if (is_basis_mball(ob)) {
+               if (BKE_metaball_is_basis(ob)) {
                        drawDispListwire(&ob->disp);
                }
        }
@@ -6556,7 +6556,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                                        zbufoff = 1;
                                        dt = OB_SOLID;
                                }
-                               else if(ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT))
+                               else if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT))
                                        dt = OB_PAINT;
 
                                glEnable(GL_DEPTH_TEST);
@@ -6700,7 +6700,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                        cu = ob->data;
 
                        if (cu->editnurb) {
-                               ListBase *nurbs = curve_editnurbs(cu);
+                               ListBase *nurbs = BKE_curve_editNurbs_get(cu);
                                drawnurb(scene, v3d, rv3d, base, nurbs->first, dt);
                        }
                        else if (dt == OB_BOUNDBOX) {