Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-08-26 04:38:43 +0400
committerJoshua Leung <aligorith@gmail.com>2009-08-26 04:38:43 +0400
commit4893cdc33855e566dade323fa2f8486536821018 (patch)
tree0b62b01f06d45085aa59e3f8b7d04269df651aa8 /source/blender/editors
parent3f5a2a11944a2e983d62babe8bb02b03e14c805d (diff)
2.5 - Warning cleanups (for mingw+scons)
Also, made the Outliner's horizontal scrollbar work better for keymaps view. It's still using an approximation of the width, but at least you can scroll now.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/keyframes_general.c131
-rw-r--r--source/blender/editors/interface/interface_regions.c2
-rw-r--r--source/blender/editors/interface/interface_templates.c2
-rw-r--r--source/blender/editors/interface/interface_widgets.c8
-rw-r--r--source/blender/editors/space_outliner/outliner.c5
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c4
7 files changed, 79 insertions, 75 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index fc67ee34a2e..ced3c117700 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -127,11 +127,11 @@ void duplicate_fcurve_keys(FCurve *fcu)
{
BezTriple *newbezt;
int i;
-
- if (fcu == NULL)
+
+ /* this can only work when there is an F-Curve, and also when there are some BezTriples */
+ if ELEM(NULL, fcu, fcu->bezt)
return;
- // XXX this does not take into account sample data...
for (i=0; i < fcu->totvert; i++) {
/* If a key is selected */
if (fcu->bezt[i].f2 & SELECT) {
@@ -160,7 +160,7 @@ void duplicate_fcurve_keys(FCurve *fcu)
/* **************************************************** */
/* Various Tools */
-/* Basic IPO-Curve 'cleanup' function that removes 'double points' and unnecessary keyframes on linear-segments only */
+/* Basic F-Curve 'cleanup' function that removes 'double points' and unnecessary keyframes on linear-segments only */
void clean_fcurve(FCurve *fcu, float thresh)
{
BezTriple *old_bezts, *bezt, *beztn;
@@ -285,74 +285,74 @@ void smooth_fcurve (FCurve *fcu)
}
}
- /* if any points were selected, allocate tSmooth_Bezt points to work on */
- if (totSel >= 3) {
- tSmooth_Bezt *tarray, *tsb;
-
- /* allocate memory in one go */
- tsb= tarray= MEM_callocN(totSel*sizeof(tSmooth_Bezt), "tSmooth_Bezt Array");
-
- /* populate tarray with data of selected points */
- bezt= fcu->bezt;
- for (i=0, x=0; (i < fcu->totvert) && (x < totSel); i++, bezt++) {
- if (BEZSELECTED(bezt)) {
- /* tsb simply needs pointer to vec, and index */
- tsb->h1 = &bezt->vec[0][1];
- tsb->h2 = &bezt->vec[1][1];
- tsb->h3 = &bezt->vec[2][1];
-
- /* advance to the next tsb to populate */
- if (x < totSel- 1)
- tsb++;
- else
- break;
- }
+ /* if any points were selected, allocate tSmooth_Bezt points to work on */
+ if (totSel >= 3) {
+ tSmooth_Bezt *tarray, *tsb;
+
+ /* allocate memory in one go */
+ tsb= tarray= MEM_callocN(totSel*sizeof(tSmooth_Bezt), "tSmooth_Bezt Array");
+
+ /* populate tarray with data of selected points */
+ bezt= fcu->bezt;
+ for (i=0, x=0; (i < fcu->totvert) && (x < totSel); i++, bezt++) {
+ if (BEZSELECTED(bezt)) {
+ /* tsb simply needs pointer to vec, and index */
+ tsb->h1 = &bezt->vec[0][1];
+ tsb->h2 = &bezt->vec[1][1];
+ tsb->h3 = &bezt->vec[2][1];
+
+ /* advance to the next tsb to populate */
+ if (x < totSel- 1)
+ tsb++;
+ else
+ break;
}
+ }
- /* calculate the new smoothed F-Curve's with weighted averages:
- * - this is done with two passes
- * - uses 5 points for each operation (which stores in the relevant handles)
- * - previous: w/a ratio = 3:5:2:1:1
- * - next: w/a ratio = 1:1:2:5:3
- */
-
- /* round 1: calculate previous and next */
- tsb= tarray;
- for (i=0; i < totSel; i++, tsb++) {
- /* don't touch end points (otherwise, curves slowly explode) */
- if (ELEM(i, 0, (totSel-1)) == 0) {
- const tSmooth_Bezt *tP1 = tsb - 1;
- const tSmooth_Bezt *tP2 = (i-2 > 0) ? (tsb - 2) : (NULL);
- const tSmooth_Bezt *tN1 = tsb + 1;
- const tSmooth_Bezt *tN2 = (i+2 < totSel) ? (tsb + 2) : (NULL);
-
- const float p1 = *tP1->h2;
- const float p2 = (tP2) ? (*tP2->h2) : (*tP1->h2);
- const float c1 = *tsb->h2;
- const float n1 = *tN1->h2;
- const float n2 = (tN2) ? (*tN2->h2) : (*tN1->h2);
+ /* calculate the new smoothed F-Curve's with weighted averages:
+ * - this is done with two passes
+ * - uses 5 points for each operation (which stores in the relevant handles)
+ * - previous: w/a ratio = 3:5:2:1:1
+ * - next: w/a ratio = 1:1:2:5:3
+ */
+
+ /* round 1: calculate previous and next */
+ tsb= tarray;
+ for (i=0; i < totSel; i++, tsb++) {
+ /* don't touch end points (otherwise, curves slowly explode) */
+ if (ELEM(i, 0, (totSel-1)) == 0) {
+ const tSmooth_Bezt *tP1 = tsb - 1;
+ const tSmooth_Bezt *tP2 = (i-2 > 0) ? (tsb - 2) : (NULL);
+ const tSmooth_Bezt *tN1 = tsb + 1;
+ const tSmooth_Bezt *tN2 = (i+2 < totSel) ? (tsb + 2) : (NULL);
+
+ const float p1 = *tP1->h2;
+ const float p2 = (tP2) ? (*tP2->h2) : (*tP1->h2);
+ const float c1 = *tsb->h2;
+ const float n1 = *tN1->h2;
+ const float n2 = (tN2) ? (*tN2->h2) : (*tN1->h2);
+
+ /* calculate previous and next */
+ *tsb->h1= (3*p2 + 5*p1 + 2*c1 + n1 + n2) / 12;
+ *tsb->h3= (p2 + p1 + 2*c1 + 5*n1 + 3*n2) / 12;
+ }
+ }
+
+ /* round 2: calculate new values and reset handles */
+ tsb= tarray;
+ for (i=0; i < totSel; i++, tsb++) {
+ /* calculate new position by averaging handles */
+ *tsb->h2 = (*tsb->h1 + *tsb->h3) / 2;
- /* calculate previous and next */
- *tsb->h1= (3*p2 + 5*p1 + 2*c1 + n1 + n2) / 12;
- *tsb->h3= (p2 + p1 + 2*c1 + 5*n1 + 3*n2) / 12;
+ /* reset handles now */
+ *tsb->h1 = *tsb->h2;
+ *tsb->h3 = *tsb->h2;
}
- }
-
- /* round 2: calculate new values and reset handles */
- tsb= tarray;
- for (i=0; i < totSel; i++, tsb++) {
- /* calculate new position by averaging handles */
- *tsb->h2 = (*tsb->h1 + *tsb->h3) / 2;
- /* reset handles now */
- *tsb->h1 = *tsb->h2;
- *tsb->h3 = *tsb->h2;
+ /* free memory required for tarray */
+ MEM_freeN(tarray);
}
- /* free memory required for tarray */
- MEM_freeN(tarray);
-}
-
/* recalculate handles */
calchandles_fcurve(fcu);
}
@@ -371,7 +371,6 @@ ListBase animcopybuf = {NULL, NULL};
static float animcopy_firstframe= 999999999.0f;
/* datatype for use in copy/paste buffer */
-// XXX F-Curve editor should use this too
typedef struct tAnimCopybufItem {
struct tAnimCopybufItem *next, *prev;
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index e83dca5a500..1d911fef418 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -1330,7 +1330,7 @@ static void ui_block_func_MENUSTR(bContext *C, uiLayout *layout, void *arg_str)
{
uiBlock *block= uiLayoutGetBlock(layout);
uiPopupBlockHandle *handle= block->handle;
- uiLayout *split, *column;
+ uiLayout *split, *column=NULL;
uiBut *bt;
MenuData *md;
MenuEntry *entry;
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 4cfc44e56c8..6aa5f5efc41 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1318,7 +1318,7 @@ ListBase uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, char *pr
Panel *pa;
ListBase lb, *itemlb;
char *name, str[32];
- int icon=0, i= 0, activei= 0, len, items, found, min, max;
+ int icon=0, i= 0, activei= 0, len= 0, items, found, min, max;
lb.first= lb.last= NULL;
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index a55b11afe48..f0085f71373 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1946,12 +1946,12 @@ static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int
{
if(state & UI_ACTIVE) {
uiWidgetBase wtb;
- float rad= 0.5f*(rect->ymax - rect->ymin);
+ float rad= 0.5f*(rect->ymax - rect->ymin); // 4.0f
widget_init(&wtb);
/* half rounded */
- round_box_edges(&wtb, 15, rect, 4.0f);
+ round_box_edges(&wtb, 15, rect, rad);
widgetbase_draw(&wtb, wcol);
}
@@ -2045,12 +2045,12 @@ static void widget_but(uiWidgetColors *wcol, rcti *rect, int state, int roundbox
static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
{
uiWidgetBase wtb;
- float rad= 0.5f*(rect->ymax - rect->ymin);
+ float rad= 5.0f; //0.5f*(rect->ymax - rect->ymin);
widget_init(&wtb);
/* half rounded */
- round_box_edges(&wtb, roundboxalign, rect, 5.0f);
+ round_box_edges(&wtb, roundboxalign, rect, rad);
widgetbase_draw(&wtb, wcol);
}
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index d564573a543..fca5b0cc59a 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -5274,7 +5274,10 @@ void draw_outliner(const bContext *C)
sizex_rna= MAX2(OL_RNA_COLX, sizex_rna+OL_RNA_COL_SPACEX);
/* get width of data (for setting 'tot' rect, this is column 1 + column 2 + a bit extra) */
- sizex= sizex_rna + OL_RNA_COL_SIZEX + 50;
+ if (soops->outlinevis == SO_KEYMAP)
+ sizex= sizex_rna + OL_RNA_COL_SIZEX*3 + 50; // XXX this is only really a quick hack to make this wide enough...
+ else
+ sizex= sizex_rna + OL_RNA_COL_SIZEX + 50;
}
else {
/* width must take into account restriction columns (if visible) so that entries will still be visible */
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 5d58ea431a9..bdedef4b6c8 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -291,7 +291,7 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op)
struct anim *an;
char filename[FILE_MAX];
- Sequence *seq, *soundseq; /* generic strip vars */
+ Sequence *seq, *soundseq=NULL; /* generic strip vars */
Strip *strip;
StripElem *se;
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index 6773985e07c..eee85f21798 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -1005,9 +1005,10 @@ static uiBlock *view3d_object_mirrormenu(bContext *C, ARegion *ar, void *arg_unu
#endif
#endif
+#if 0
static void view3d_edit_object_transformmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
-#if 0
+#if 0 // XXX not used anymore
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Scale/Rotation to ObData|Ctrl A, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
apply_objects_locrot();
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Visual Transform|Ctrl A, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
@@ -1024,6 +1025,7 @@ static void view3d_edit_object_transformmenu(bContext *C, uiLayout *layout, void
uiItemO(layout, NULL, 0, "OBJECT_OT_scale_clear");
uiItemO(layout, NULL, 0, "OBJECT_OT_origin_clear");
}
+#endif
#if 0
static void do_view3d_edit_object_makelocalmenu(bContext *C, void *arg, int event)