Revision: 58737
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58737
Author:   lockal
Date:     2013-07-30 08:45:45 +0000 (Tue, 30 Jul 2013)
Log Message:
-----------
Remove superfluous iterations (caused by typo) and type casts in outliner

This significantly lowers the position of outliner_draw_tree_element in profiler
and partially fixes [#36260] (2,300 Objects Makes Blender Unresponsive)

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_outliner/outliner_draw.c
    trunk/blender/source/blender/editors/space_outliner/outliner_edit.c
    trunk/blender/source/blender/editors/space_outliner/outliner_intern.h
    trunk/blender/source/blender/editors/space_outliner/outliner_tree.c

Modified: trunk/blender/source/blender/editors/space_outliner/outliner_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_draw.c 
2013-07-30 08:30:15 UTC (rev 58736)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_draw.c 
2013-07-30 08:45:45 UTC (rev 58737)
@@ -539,21 +539,21 @@
                                
                                uiBlockSetEmboss(block, UI_EMBOSSN);
                                bt = uiDefIconButR(block, ICONTOG, 0, 
ICON_RESTRICT_VIEW_OFF,
-                                                  (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), (int)te->ys, UI_UNIT_X, UI_UNIT_Y,
+                                                  (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X, UI_UNIT_Y,
                                                   &ptr, "hide", -1, 0, 0, -1, 
-1,
                                                   TIP_("Restrict viewport 
visibility (Ctrl - Recursive)"));
                                uiButSetFunc(bt, restrictbutton_view_cb, scene, 
ob);
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
                                
                                bt = uiDefIconButR(block, ICONTOG, 0, 
ICON_RESTRICT_SELECT_OFF,
-                                                  (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_SELECTX), (int)te->ys, UI_UNIT_X, UI_UNIT_Y,
+                                                  (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X, UI_UNIT_Y,
                                                   &ptr, "hide_select", -1, 0, 
0, -1, -1,
                                                   TIP_("Restrict viewport 
selection (Ctrl - Recursive)"));
                                uiButSetFunc(bt, restrictbutton_sel_cb, scene, 
ob);
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
                                
                                bt = uiDefIconButR(block, ICONTOG, 0, 
ICON_RESTRICT_RENDER_OFF,
-                                                  (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_RENDERX), (int)te->ys, UI_UNIT_X, UI_UNIT_Y,
+                                                  (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_RENDERX), te->ys, UI_UNIT_X, UI_UNIT_Y,
                                                   &ptr, "hide_render", -1, 0, 
0, -1, -1,
                                                   TIP_("Restrict rendering 
(Ctrl - Recursive)"));
                                uiButSetFunc(bt, restrictbutton_rend_cb, scene, 
ob);
@@ -570,21 +570,21 @@
 
                                restrict_bool = group_restrict_flag(gr, 
OB_RESTRICT_VIEW);
                                bt = uiDefIconBut(block, ICONTOG, 0, 
restrict_bool ? ICON_RESTRICT_VIEW_ON : ICON_RESTRICT_VIEW_OFF,
-                                                 (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), (int)te->ys, UI_UNIT_X, UI_UNIT_Y,
+                                                 (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X, UI_UNIT_Y,
                                                  NULL, 0, 0, 0, 0, 
TIP_("Restrict/Allow visibility in the 3D View"));
                                uiButSetFunc(bt, 
restrictbutton_gr_restrict_view, scene, gr);
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
 
                                restrict_bool = group_restrict_flag(gr, 
OB_RESTRICT_SELECT);
                                bt = uiDefIconBut(block, ICONTOG, 0, 
restrict_bool ? ICON_RESTRICT_SELECT_ON : ICON_RESTRICT_SELECT_OFF,
-                                                 (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_SELECTX), (int)te->ys, UI_UNIT_X, UI_UNIT_Y,
+                                                 (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X, UI_UNIT_Y,
                                                  NULL, 0, 0, 0, 0, 
TIP_("Restrict/Allow selection in the 3D View"));
                                uiButSetFunc(bt, 
restrictbutton_gr_restrict_select, scene, gr);
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
 
                                restrict_bool = group_restrict_flag(gr, 
OB_RESTRICT_RENDER);
                                bt = uiDefIconBut(block, ICONTOG, 0, 
restrict_bool ? ICON_RESTRICT_RENDER_ON : ICON_RESTRICT_RENDER_OFF,
-                                                 (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_RENDERX), (int)te->ys, UI_UNIT_X, UI_UNIT_Y,
+                                                 (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_RENDERX), te->ys, UI_UNIT_X, UI_UNIT_Y,
                                                  NULL, 0, 0, 0, 0, 
TIP_("Restrict/Allow renderability"));
                                uiButSetFunc(bt, 
restrictbutton_gr_restrict_render, scene, gr);
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
@@ -596,7 +596,7 @@
                                uiBlockSetEmboss(block, UI_EMBOSSN);
                                
                                bt = uiDefIconButBitI(block, ICONTOGN, 
SCE_LAY_DISABLE, 0, ICON_CHECKBOX_HLT - 1,
-                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), (int)te->ys, UI_UNIT_X,
+                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X,
                                                      UI_UNIT_Y, 
te->directdata, 0, 0, 0, 0, TIP_("Render this RenderLayer"));
                                uiButSetFunc(bt, restrictbutton_r_lay_cb, 
tselem->id, NULL);
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
@@ -611,7 +611,7 @@
                                
                                
                                bt = uiDefIconButBitI(block, ICONTOG, passflag, 
0, ICON_CHECKBOX_HLT - 1,
-                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), (int)te->ys, UI_UNIT_X,
+                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X,
                                                      UI_UNIT_Y, layflag, 0, 0, 
0, 0, TIP_("Render this Pass"));
                                uiButSetFunc(bt, restrictbutton_r_lay_cb, 
tselem->id, NULL);
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
@@ -621,7 +621,7 @@
                                          SCE_PASS_INDIRECT, SCE_PASS_EMIT, 
SCE_PASS_ENVIRONMENT))
                                {
                                        bt = uiDefIconButBitI(block, TOG, 
passflag, 0, (*layflag & passflag) ? ICON_DOT : ICON_BLANK1,
-                                                             
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), (int)te->ys, UI_UNIT_X,
+                                                             
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X,
                                                              UI_UNIT_Y, 
layflag, 0, 0, 0, 0, TIP_("Exclude this Pass from Combined"));
                                        uiButSetFunc(bt, 
restrictbutton_r_lay_cb, tselem->id, NULL);
                                        uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
@@ -635,14 +635,14 @@
                                
                                uiBlockSetEmboss(block, UI_EMBOSSN);
                                bt = uiDefIconButBitI(block, ICONTOGN, 
eModifierMode_Realtime, 0, ICON_RESTRICT_VIEW_OFF,
-                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), (int)te->ys, UI_UNIT_X,
+                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X,
                                                      UI_UNIT_Y, &(md->mode), 
0, 0, 0, 0,
                                                      TIP_("Restrict/Allow 
visibility in the 3D View"));
                                uiButSetFunc(bt, restrictbutton_modifier_cb, 
scene, ob);
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
                                
                                bt = uiDefIconButBitI(block, ICONTOGN, 
eModifierMode_Render, 0, ICON_RESTRICT_RENDER_OFF,
-                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_RENDERX), (int)te->ys, UI_UNIT_X,
+                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_RENDERX), te->ys, UI_UNIT_X,
                                                      UI_UNIT_Y, &(md->mode), 
0, 0, 0, 0, TIP_("Restrict/Allow renderability"));
                                uiButSetFunc(bt, restrictbutton_modifier_cb, 
scene, ob);
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
@@ -656,14 +656,14 @@
                                
                                uiBlockSetEmboss(block, UI_EMBOSSN);
                                bt = uiDefIconButBitI(block, ICONTOG, 
BONE_HIDDEN_P, 0, ICON_RESTRICT_VIEW_OFF,
-                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), (int)te->ys, UI_UNIT_X,
+                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X,
                                                      UI_UNIT_Y, &(bone->flag), 
0, 0, 0, 0,
                                                      TIP_("Restrict/Allow 
visibility in the 3D View"));
                                uiButSetFunc(bt, 
restrictbutton_bone_visibility_cb, ob->data, bone);
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
                                
                                bt = uiDefIconButBitI(block, ICONTOG, 
BONE_UNSELECTABLE, 0, ICON_RESTRICT_SELECT_OFF,
-                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_SELECTX), (int)te->ys, UI_UNIT_X,
+                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X,
                                                      UI_UNIT_Y, &(bone->flag), 
0, 0, 0, 0,
                                                      TIP_("Restrict/Allow 
selection in the 3D View"));
                                uiButSetFunc(bt, restrictbutton_bone_select_cb, 
ob->data, bone);
@@ -676,14 +676,14 @@
                                
                                uiBlockSetEmboss(block, UI_EMBOSSN);
                                bt = uiDefIconButBitI(block, ICONTOG, 
BONE_HIDDEN_A, 0, ICON_RESTRICT_VIEW_OFF,
-                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), (int)te->ys, UI_UNIT_X,
+                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X,
                                                      UI_UNIT_Y, 
&(ebone->flag), 0, 0, 0, 0,
                                                      TIP_("Restrict/Allow 
visibility in the 3D View"));
                                uiButSetFunc(bt, 
restrictbutton_ebone_visibility_cb, NULL, ebone);
                                uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
                                
                                bt = uiDefIconButBitI(block, ICONTOG, 
BONE_UNSELECTABLE, 0, ICON_RESTRICT_SELECT_OFF,
-                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_SELECTX), (int)te->ys, UI_UNIT_X,
+                                                     (int)(ar->v2d.cur.xmax - 
OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X,
                                                      UI_UNIT_Y, 
&(ebone->flag), 0, 0, 0, 0,
                                                      TIP_("Restrict/Allow 
selection in the 3D View"));
                                uiButSetFunc(bt, 
restrictbutton_ebone_select_cb, NULL, ebone);
@@ -735,7 +735,7 @@
                                prop = te->directdata;
                                
                                if (!(RNA_property_type(prop) == PROP_POINTER 
&& (TSELEM_OPEN(tselem, soops)))) {
-                                       uiDefAutoButR(block, ptr, prop, -1, "", 
ICON_NONE, sizex, (int)te->ys, OL_RNA_COL_SIZEX,
+                                       uiDefAutoButR(block, ptr, prop, -1, "", 
ICON_NONE, sizex, te->ys, OL_RNA_COL_SIZEX,
                                                      UI_UNIT_Y - 1);
                                }
                        }
@@ -743,7 +743,7 @@
                                ptr = &te->rnaptr;
                                prop = te->directdata;
                                
-                               uiDefAutoButR(block, ptr, prop, te->index, "", 
ICON_NONE, sizex, (int)te->ys, OL_RNA_COL_SIZEX,
+                               uiDefAutoButR(block, ptr, prop, te->index, "", 
ICON_NONE, sizex, te->ys, OL_RNA_COL_SIZEX,
                                              UI_UNIT_Y - 1);
                        }
                }
@@ -960,7 +960,7 @@
                                        /* pass */
                                }
                                else {
-                                       uiDefBlockBut(block, 
operator_search_menu, kmi, "", xstart, (int)te->ys + 1, butw1, UI_UNIT_Y - 1,
+                                       uiDefBlockBut(block, 
operator_search_menu, kmi, "", xstart, te->ys + 1, butw1, UI_UNIT_Y - 1,
                                                      TIP_("Assign new 
Operator"));
                                }
                                xstart += butw1 + 10;
@@ -969,7 +969,7 @@
                                kmi->maptype = keymap_menu_type(kmi->type);
                                
                                str = keymap_type_menu();
-                               but = uiDefButS(block, MENU, 0, str,    xstart, 
(int)te->ys + 1, butw2, UI_UNIT_Y - 1, &kmi->maptype,
+                               but = uiDefButS(block, MENU, 0, str,    xstart, 
te->ys + 1, butw2, UI_UNIT_Y - 1, &kmi->maptype,
                                                0, 0, 0, 0, TIP_("Event type"));
                                uiButSetFunc(but, keymap_type_cb, kmi, NULL);
                                xstart += butw2 + 5;
@@ -977,48 +977,48 @@
                                /* edit actual event */
                                switch (kmi->maptype) {
                                        case OL_KM_KEYBOARD:

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to