== Sculpt Mode ==
authorNicholas Bishop <nicholasbishop@gmail.com>
Sun, 24 Jun 2007 23:02:58 +0000 (23:02 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Sun, 24 Jun 2007 23:02:58 +0000 (23:02 +0000)
Removed the draw_flag field from SculptData, moved the two draw flags over to SculptData.flags

source/blender/makesdna/DNA_scene_types.h
source/blender/src/drawobject.c
source/blender/src/drawview.c
source/blender/src/header_view3d.c
source/blender/src/sculptmode.c

index 69a24826c22fae9080d3ba5e302b42b6f9814460..4dc6403e60553f3531e5a08cc628333e86020e4f 100644 (file)
@@ -390,16 +390,12 @@ typedef struct SculptData
        char averaging;
        char flags;
        
-       char draw_flag;
-       
        /* Control tablet input */
        char tablet_size, tablet_strength;
        
        /* Symmetry is separate from the other BrushData because the same
           settings are always used for all brush types */
        char symm;
-
-       char pad[7];
 } SculptData;
 
 typedef struct Scene {
@@ -608,21 +604,20 @@ typedef struct Scene {
 
 /* SculptData.flags */
 #define SCULPT_INPUT_SMOOTH 1
+#define SCULPT_DRAW_FAST    2
+#define SCULPT_DRAW_BRUSH   4
 /* SculptData.brushtype */
-#define DRAW_BRUSH 1
-#define SMOOTH_BRUSH 2
-#define PINCH_BRUSH 3
+#define DRAW_BRUSH    1
+#define SMOOTH_BRUSH  2
+#define PINCH_BRUSH   3
 #define INFLATE_BRUSH 4
-#define GRAB_BRUSH 5
-#define LAYER_BRUSH 6
+#define GRAB_BRUSH    5
+#define LAYER_BRUSH   6
 #define FLATTEN_BRUSH 7
 /* SculptData.texrept */
 #define SCULPTREPT_DRAG 1
 #define SCULPTREPT_TILE 2
 #define SCULPTREPT_3D   3
-/* SculptData.draw_flag */
-#define SCULPTDRAW_FAST  1
-#define SCULPTDRAW_BRUSH 2
 
 #define SYMM_X 1
 #define SYMM_Y 2
index 2159e3823e8164b1ad8f414fa772ecd0c57f8aad..2b0c8f7c14ecb92c0ac780a36b16de2fc70632b1 100644 (file)
@@ -2184,7 +2184,7 @@ static int draw_mesh_object(Base *base, int dt, int flag)
                        cageDM->release(cageDM);
                finalDM->release(finalDM);
        }
-       else if(!G.obedit && (G.f & G_SCULPTMODE) &&(G.scene->sculptdata.draw_flag & SCULPTDRAW_FAST) &&
+       else if(!G.obedit && (G.f & G_SCULPTMODE) &&(G.scene->sculptdata.flags & SCULPT_DRAW_FAST) &&
                OBACT==ob && !sculpt_modifiers_active(ob)) {
                sculptmode_draw_mesh(0);
        }
index cd995e95c271a74b5330957afb950c26ab109e8b..8cbd7c66a702fcf9b74ec5f6e714c9379ca0cd1d 100644 (file)
@@ -2980,7 +2980,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
                                sdrawXORline(pd->origloc[0], pd->origloc[1], mouse[0], mouse[1]);
                        }
                }
-               else if(sculpt_data()->draw_flag & SCULPTDRAW_BRUSH) {
+               else if(sculpt_data()->flags & SCULPT_DRAW_BRUSH) {
                        short csc[2], car[2];
                        getmouseco_sc(csc);
                        getmouseco_areawin(car);
index 99f5029920335adc0c674c79823f893aed7ccaa1..9274303570765fc6d8bd3081dd5821972a8d16b0 100644 (file)
@@ -4231,10 +4231,10 @@ void do_view3d_sculptmenu(void *arg, int event)
                        G.vd->pivot_last= !G.vd->pivot_last;
                break;
        case 12:
-               sd->draw_flag ^= SCULPTDRAW_FAST;
+               sd->flags ^= SCULPT_DRAW_FAST;
                break;
        case 13:
-               sd->draw_flag ^= SCULPTDRAW_BRUSH;
+               sd->flags ^= SCULPT_DRAW_BRUSH;
                break;
        case 14:
                add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW);
@@ -4288,8 +4288,8 @@ uiBlock *view3d_sculptmenu(void *arg_unused)
        uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
        uiDefIconTextBlockBut(block, view3d_sculpt_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input Settings", 0, yco-=20, 120, 19, "");
        uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-       uiDefIconTextBut(block, BUTM, 1, ((sd->draw_flag & SCULPTDRAW_BRUSH) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Display Brush", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
-       uiDefIconTextBut(block, BUTM, 1, ((sd->draw_flag & SCULPTDRAW_FAST) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Partial Redraw", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
+       uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_DRAW_BRUSH) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Display Brush", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
+       uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_DRAW_FAST) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Partial Redraw", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
        if(G.vd)
                uiDefIconTextBut(block, BUTM, 1, (G.vd->pivot_last ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pivot Last", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
 
index 2e42430203d9e8a9fba199423bbe336b8aedd8a9..fa6df2ead0b16ab5f0e06c1bc12f52b6e57df60f 100644 (file)
@@ -222,7 +222,7 @@ void sculptmode_init(Scene *sce)
        sd->averaging= 1;
        sd->texsep= 0;
        sd->texrept= SCULPTREPT_DRAG;
-       sd->draw_flag= SCULPTDRAW_BRUSH;
+       sd->flags= SCULPT_DRAW_BRUSH;
        sd->tablet_size=3;
        sd->tablet_strength=10;
 }
@@ -1395,7 +1395,7 @@ void sculptmode_propset_init(PropsetMode mode)
 
 void sculpt_paint_brush(char clear)
 {
-       if(sculpt_data()->draw_flag & SCULPTDRAW_BRUSH) {
+       if(sculpt_data()->flags & SCULPT_DRAW_BRUSH) {
                static short mvalo[2];
                short mval[2];
                const short rad= sculptmode_brush()->size;
@@ -1711,7 +1711,7 @@ void sculpt(void)
        e.scale[2]= 1.0f / ob->size[2];
 
        /* Capture original copy */
-       if(sd->draw_flag & SCULPTDRAW_FAST)
+       if(sd->flags & SCULPT_DRAW_FAST)
                glAccum(GL_LOAD, 1);
 
        while (get_mbut() & mousebut) {
@@ -1745,7 +1745,7 @@ void sculpt(void)
                        if(modifier_calculations || ob_get_keyblock(ob))
                                DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
 
-                       if(modifier_calculations || sd->brush_type == GRAB_BRUSH || !(sd->draw_flag & SCULPTDRAW_FAST)) {
+                       if(modifier_calculations || sd->brush_type == GRAB_BRUSH || !(sd->flags & SCULPT_DRAW_FAST)) {
                                calc_damaged_verts(&ss->damaged_verts,e.grabdata);
                                scrarea_do_windraw(curarea);
                                screen_swapbuffers();
@@ -1788,7 +1788,7 @@ void sculpt(void)
                                glEnable(GL_SCISSOR_TEST);
                                
                                /* Draw cursor */
-                               if(sculpt_data()->draw_flag & SCULPTDRAW_BRUSH) {
+                               if(sculpt_data()->flags & SCULPT_DRAW_BRUSH) {
                                        persp(PERSP_WIN);
                                        glDisable(GL_DEPTH_TEST);
                                        fdrawXORcirc((float)mouse[0],(float)mouse[1],sculptmode_brush()->size);