Fix some errors in partial visibility drawing.
authorNicholas Bishop <nicholasbishop@gmail.com>
Wed, 14 Mar 2012 07:37:47 +0000 (07:37 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Wed, 14 Mar 2012 07:37:47 +0000 (07:37 +0000)
Also changed show-in-border key to SHIFT+H as suggested by Daniel
Salazar.

source/blender/editors/sculpt_paint/paint_ops.c
source/blender/gpu/intern/gpu_buffers.c

index 9f9f3ab22898d3a076b073427f71a5a18832e0ff..dd6e7cad16b69a459b02baf7551f556529376207 100644 (file)
@@ -528,7 +528,7 @@ void paint_partial_visibility_keys(wmKeyMap *keymap)
        wmKeyMapItem *kmi;
        
        /* Partial visiblity */
-       kmi= WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, KM_CTRL, 0);
+       kmi= WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, KM_SHIFT, 0);
        RNA_enum_set(kmi->ptr, "action", PARTIALVIS_SHOW);
        RNA_enum_set(kmi->ptr, "area", PARTIALVIS_INSIDE);
        kmi= WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, 0, 0);
index 65eefe6bc1e11f3564f0ae54a2cb17a4400a0b33..92b14409ce7ab1cefca91aa9d9c73187535453bd 100644 (file)
@@ -1479,7 +1479,7 @@ static int gpu_count_grid_quads(BLI_bitmap *grid_hidden,
                        /* grid hidden are present, have to check each element */
                        for(y = 0; y < gridsize-1; y++) {
                                for(x = 0; x < gridsize-1; x++) {
-                                       if(paint_is_grid_face_hidden(gh, gridsize, x, y))
+                                       if(!paint_is_grid_face_hidden(gh, gridsize, x, y))
                                                totquad++;
                                }
                        }
@@ -1595,7 +1595,7 @@ GPU_Buffers *GPU_build_grid_buffers(int *grid_indices, int totgrid,
 {
        GPU_Buffers *buffers;
        int totquad;
-       int fully_visible_totquad = (gridsize-1) * (gridsize-1);
+       int fully_visible_totquad = (gridsize-1) * (gridsize-1) * totgrid;
 
        buffers = MEM_callocN(sizeof(GPU_Buffers), "GPU_Buffers");
        buffers->grid_hidden = grid_hidden;
@@ -1609,7 +1609,7 @@ GPU_Buffers *GPU_build_grid_buffers(int *grid_indices, int totgrid,
                gpu_get_grid_buffer(gridsize, &buffers->index_type, &buffers->tot_quad);
                buffers->has_hidden = 0;
        }
-       else if(!GLEW_ARB_vertex_buffer_object || (U.gameflags & USER_DISABLE_VBO)) {
+       else if(GLEW_ARB_vertex_buffer_object && !(U.gameflags & USER_DISABLE_VBO)) {
                /* Build new VBO */
                glGenBuffersARB(1, &buffers->index_buf);
                if(buffers->index_buf) {