Merged changes in the trunk up to revision 48893.
[blender-staging.git] / source / blender / editors / space_view3d / drawobject.c
index 7210944d3e72c25cfbb51e4f55c234fdb2803ace..919772bbf46e63142ef0d45776a380c0c57afd87 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "DNA_camera_types.h"
 #include "DNA_curve_types.h"
-#include "DNA_constraint_types.h" // for drawing constraint
+#include "DNA_constraint_types.h"  /* for drawing constraint */
 #include "DNA_lamp_types.h"
 #include "DNA_lattice_types.h"
 #include "DNA_material_types.h"
 #include "BLI_rand.h"
 #include "BLI_utildefines.h"
 
-#include "BKE_anim.h"  //for the where_on_path function
+#include "BKE_anim.h"  /* for the where_on_path function */
 #include "BKE_armature.h"
 #include "BKE_camera.h"
-#include "BKE_constraint.h" // for the get_constraint_target function
+#include "BKE_constraint.h"  /* for the get_constraint_target function */
 #include "BKE_curve.h"
 #include "BKE_DerivedMesh.h"
 #include "BKE_deform.h"
 #include "wm_subwindow.h"
 #include "BLF_api.h"
 
-#include "view3d_intern.h"  // own include
+#include "view3d_intern.h"  /* own include */
 
 typedef enum eWireDrawMode {
        OBDRAW_WIRE_OFF = 0,
@@ -2118,7 +2118,7 @@ static void drawSelectedVertices__mapFunc(void *userData, int index, const float
        if (!(mv->flag & ME_HIDE)) {
                const char sel = mv->flag & SELECT;
 
-               // TODO define selected color
+               /* TODO define selected color */
                if (sel) {
                        glColor3f(1.0f, 1.0f, 0.0f);
                }
@@ -2797,7 +2797,7 @@ static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit,
        ToolSettings *ts = scene->toolsettings;
        int sel;
 
-       if (v3d->zbuf) glDepthMask(0);      // disable write in zbuffer, zbuf select
+       if (v3d->zbuf) glDepthMask(0);  /* disable write in zbuffer, zbuf select */
 
        for (sel = 0; sel < 2; sel++) {
                unsigned char col[4], fcol[4];
@@ -3218,8 +3218,8 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
                        glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
                }
 
-               // Setup for drawing wire over, disable zbuffer
-               // write to show selected edge wires better
+               /* Setup for drawing wire over, disable zbuffer
+                * write to show selected edge wires better */
                UI_ThemeColor(TH_WIRE);
 
                bglPolygonOffset(rv3d->dist, 1.0);
@@ -3239,21 +3239,21 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
                UI_GetThemeColor4ubv(TH_FACE_SELECT, col2);
                UI_GetThemeColor4ubv(TH_FREESTYLE_FACE_MARK, col3);
                UI_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, col4);
-               
+
                glEnable(GL_BLEND);
-               glDepthMask(0);     // disable write in zbuffer, needed for nice transp
-               
+               glDepthMask(0);  /* disable write in zbuffer, needed for nice transp */
+
                /* don't draw unselected faces, only selected, this is MUCH nicer when texturing */
                if (check_object_draw_texture(scene, v3d, dt))
                        col1[3] = 0;
-               
+
                if (!(me->drawflag & ME_DRAW_FREESTYLE_FACE))
                        col3[3] = 0;
 
                draw_dm_faces_sel(em, cageDM, col1, col2, col3, col4, efa_act);
 
                glDisable(GL_BLEND);
-               glDepthMask(1);     // restore write in zbuffer
+               glDepthMask(1);  /* restore write in zbuffer */
        }
        else if (efa_act) {
                /* even if draw faces is off it would be nice to draw the stipple face
@@ -3262,15 +3262,15 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
                unsigned char col1[4], col2[4], col3[4], col4[4];
                col1[3] = col2[3] = col3[3] = 0; /* don't draw */
                UI_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, col4);
-               
+
                glEnable(GL_BLEND);
-               glDepthMask(0);     // disable write in zbuffer, needed for nice transp
-               
+               glDepthMask(0);  /* disable write in zbuffer, needed for nice transp */
+
                draw_dm_faces_sel(em, cageDM, col1, col2, col3, col4, efa_act);
 
                glDisable(GL_BLEND);
-               glDepthMask(1);     // restore write in zbuffer
-               
+               glDepthMask(1);  /* restore write in zbuffer */
+
        }
 
        /* here starts all fancy draw-extra over */
@@ -3613,7 +3613,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
                 */
                if (dt != OB_WIRE && (draw_wire == OBDRAW_WIRE_ON_DEPTH)) {
                        bglPolygonOffset(rv3d->dist, 1.0);
-                       glDepthMask(0); // disable write in zbuffer, selected edge wires show better
+                       glDepthMask(0);  /* disable write in zbuffer, selected edge wires show better */
                }
                
                if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && v3d->drawtype >= OB_SOLID) == 0)
@@ -3848,7 +3848,7 @@ static void drawDispListsolid(ListBase *lb, Object *ob,
        if (ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
        else glFrontFace(GL_CCW);
        
-       if (ob->type == OB_MBALL) {   // mball always smooth shaded
+       if (ob->type == OB_MBALL) {  /* mball always smooth shaded */
                glShadeModel(GL_SMOOTH);
        }
        
@@ -5669,8 +5669,8 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
                        
                        while (nr-- > 0) { /* accounts for empty bevel lists */
                                const float fac = bevp->radius * ts->normalsize;
-                               float vec_a[3]; // Offset perpendicular to the curve
-                               float vec_b[3]; // Delta along the curve
+                               float vec_a[3]; /* Offset perpendicular to the curve */
+                               float vec_b[3]; /* Delta along the curve */
 
                                vec_a[0] = fac;
                                vec_a[1] = 0.0f;
@@ -5766,7 +5766,7 @@ static void draw_empty_cone(float size)
 }
 
 /* draw points on curve speed handles */
-#if 0 // XXX old animation system stuff
+#if 0  /* XXX old animation system stuff */
 static void curve_draw_speed(Scene *scene, Object *ob)
 {
        Curve *cu = ob->data;
@@ -5795,7 +5795,7 @@ static void curve_draw_speed(Scene *scene, Object *ob)
        glPointSize(1.0);
        bglEnd();
 }
-#endif // XXX old animation system stuff
+#endif  /* XXX old animation system stuff */
 
 
 static void draw_textcurs(float textcurs[4][2])
@@ -6039,7 +6039,7 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d)
        
        /* calculus here, is reused in PFIELD_FORCE */
        invert_m4_m4(imat, rv3d->viewmatob);
-//     normalize_v3(imat[0]);          // we don't do this because field doesnt scale either... apart from wind!
+//     normalize_v3(imat[0]);  /* we don't do this because field doesnt scale either... apart from wind! */
 //     normalize_v3(imat[1]);
        
        if (pd->forcefield == PFIELD_WIND) {
@@ -6413,8 +6413,8 @@ static void drawWireExtra(Scene *scene, RegionView3D *rv3d, Object *ob)
        }
        
        bglPolygonOffset(rv3d->dist, 1.0);
-       glDepthMask(0); // disable write in zbuffer, selected edge wires show better
-       
+       glDepthMask(0);  /* disable write in zbuffer, selected edge wires show better */
+
        if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
                Curve *cu = ob->data;
                if (ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
@@ -7020,7 +7020,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 #endif
                }
 
-               // only draw domains
+               /* only draw domains */
                if (smd->domain && smd->domain->fluid) {
                        if (CFRA < smd->domain->point_cache[0]->startframe) {
                                /* don't show smoke before simulation starts, this could be made an option in the future */
@@ -7438,7 +7438,7 @@ static DMDrawOption bbs_mesh_solid_hide__setDrawOpts(void *userData, int index)
        }
 }
 
-// must have called WM_set_framebuffer_index_color beforehand
+/* must have called WM_set_framebuffer_index_color beforehand */
 static DMDrawOption bbs_mesh_solid_hide2__setDrawOpts(void *userData, int index)
 {
        Mesh *me = userData;
@@ -7492,11 +7492,11 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
 
                                bglPolygonOffset(rv3d->dist, 1.0);
 
-                               // we draw edges always, for loop (select) tools
+                               /* we draw edges always, for loop (select) tools */
                                bbs_mesh_wire(em, dm, bm_solidoffs);
                                bm_wireoffs = bm_solidoffs + em->bm->totedge;
 
-                               // we draw verts if vert select mode or if in transform (for snap).
+                               /* we draw verts if vert select mode or if in transform (for snap). */
                                if ((ts->selectmode & SCE_SELECT_VERTEX) || (G.moving & G_TRANSFORM_EDIT)) {
                                        bbs_mesh_verts(em, dm, bm_wireoffs);
                                        bm_vertoffs = bm_wireoffs + em->bm->totvert;