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:
authorCampbell Barton <ideasman42@gmail.com>2007-12-11 17:19:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-12-11 17:19:05 +0300
commit114ce86167b0000428304c5675719cfff3a771d7 (patch)
treea84c3ab3b5a0d451fea25ff33d1649e3b5b35e7d /source/blender
parent910ef6ca754579d7f605603ab1d737c89f8579c3 (diff)
display real fps in 3d view option
replace 1 with SELECT edited DVar texture tooltip
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/displist.c5
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h2
-rw-r--r--source/blender/src/buttons_editing.c4
-rw-r--r--source/blender/src/buttons_shading.c6
-rw-r--r--source/blender/src/drawobject.c17
-rw-r--r--source/blender/src/drawview.c54
-rw-r--r--source/blender/src/edit.c12
-rw-r--r--source/blender/src/editcurve.c93
-rw-r--r--source/blender/src/editlattice.c10
-rw-r--r--source/blender/src/editview.c10
-rw-r--r--source/blender/src/retopo.c2
-rw-r--r--source/blender/src/space.c5
-rw-r--r--source/blender/src/transform_conversions.c12
-rw-r--r--source/blender/src/transform_manipulator.c4
14 files changed, 139 insertions, 97 deletions
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index bea0626286e..a9f009cd876 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -152,12 +152,9 @@ DispList *find_displist(ListBase *lb, int type)
int displist_has_faces(ListBase *lb)
{
DispList *dl;
-
- dl= lb->first;
- while(dl) {
+ for(dl= lb->first; dl; dl= dl->next) {
if ELEM3(dl->type, DL_INDEX3, DL_INDEX4, DL_SURF)
return 1;
- dl= dl->next;
}
return 0;
}
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 80897253727..c37b332929d 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -227,6 +227,7 @@ extern UserDef U; /* from usiblender.c !!!! */
#define USER_CUSTOM_RANGE (1 << 17)
#define USER_ADD_EDITMODE (1 << 18)
#define USER_ADD_VIEWALIGNED (1 << 19)
+#define USER_ADD_VIEWALIGNED (1 << 19)
/* viewzom */
@@ -257,6 +258,7 @@ extern UserDef U; /* from usiblender.c !!!! */
#define USER_SHOW_VIEWPORTNAME (1 << 18)
#define USER_KEYINSERTNEED (1 << 19)
#define USER_ZOOM_TO_MOUSEPOS (1 << 20)
+#define USER_SHOW_FPS (1 << 21)
/* transopts */
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index a6ba07bfb34..ba648d3f4ad 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -539,8 +539,8 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an
bp= nu->bp;
while(a--) {
if(bp->hide==0) {
- if(event==B_MATSEL) bp->f1 |= 1;
- else bp->f1 &= ~1;
+ if(event==B_MATSEL) bp->f1 |= SELECT;
+ else bp->f1 &= ~SELECT;
}
bp++;
}
diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c
index 41363f02c70..dafd156524f 100644
--- a/source/blender/src/buttons_shading.c
+++ b/source/blender/src/buttons_shading.c
@@ -1974,7 +1974,7 @@ static void world_panel_mapto(World *wrld)
uiDefButF(block, NUMSLI, B_WORLDPRV, "G ", 10,60,135,19, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
uiDefButF(block, NUMSLI, B_WORLDPRV, "B ", 10,40,135,19, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
uiBlockEndAlign(block);
- uiDefButF(block, NUMSLI, B_WORLDPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Texture influence for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
+ uiDefButF(block, NUMSLI, B_WORLDPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
/* MAP TO */
uiBlockBeginAlign(block);
@@ -2405,7 +2405,7 @@ static void lamp_panel_mapto(Object *ob, Lamp *la)
uiDefButF(block, NUMSLI, B_LAMPPRV, "G ", 10,60,135,19, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
uiDefButF(block, NUMSLI, B_LAMPPRV, "B ", 10,40,135,19, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
uiBlockEndAlign(block);
- uiDefButF(block, NUMSLI, B_LAMPPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Texture influence for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
+ uiDefButF(block, NUMSLI, B_LAMPPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
/* MAP TO */
uiDefButBitS(block, TOG, MAP_COL, B_LAMPPRV, "Col", 10,180,135,19, &(mtex->mapto), 0, 0, 0, 0, "Lets the texture affect the basic color of the lamp");
@@ -3146,7 +3146,7 @@ static void material_panel_map_to(Object *ob, Material *ma, int from_nodes)
}
uiBlockEndAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Texture influence for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
+ uiDefButF(block, NUMSLI, B_MATPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
/* MAP TO */
uiBlockBeginAlign(block);
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index c77a74abe97..26858f657a6 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -1132,7 +1132,7 @@ static void lattice_draw_verts(Lattice *lt, DispList *dl, short sel)
int uxt = (u==0 || u==lt->pntsu-1);
if(!(lt->flag & LT_OUTSIDE) || uxt || vxt || wxt) {
if(bp->hide==0) {
- if((bp->f1 & 1)==sel) {
+ if((bp->f1 & SELECT)==sel) {
bglVertex3fv(dl?co:bp->vec);
}
}
@@ -3799,7 +3799,7 @@ static void tekenvertsN(Nurb *nu, short sel)
a= nu->pntsu*nu->pntsv;
while(a--) {
if(bp->hide==0) {
- if((bp->f1 & 1)==sel) bglVertex3fv(bp->vec);
+ if((bp->f1 & SELECT)==sel) bglVertex3fv(bp->vec);
}
bp++;
}
@@ -3842,7 +3842,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel)
for(a=nu->pntsu-1; a>0; a--, bp++) {
if(bp->hide==0 && bp1->hide==0) {
if(sel) {
- if( (bp->f1 & 1) && ( bp1->f1 & 1) ) {
+ if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT ) ) {
cpack(nurbcol[5]);
glBegin(GL_LINE_STRIP);
@@ -3852,7 +3852,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel)
}
}
else {
- if( (bp->f1 & 1) && ( bp1->f1 & 1) );
+ if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) );
else {
cpack(nurbcol[1]);
@@ -3875,7 +3875,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel)
for(a=nu->pntsv-1; a>0; a--, bp+=ofs) {
if(bp->hide==0 && bp1->hide==0) {
if(sel) {
- if( (bp->f1 & 1) && ( bp1->f1 & 1) ) {
+ if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) ) {
cpack(nurbcol[7]);
glBegin(GL_LINE_STRIP);
@@ -3885,7 +3885,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel)
}
}
else {
- if( (bp->f1 & 1) && ( bp1->f1 & 1) );
+ if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) );
else {
cpack(nurbcol[3]);
@@ -3939,8 +3939,9 @@ static void drawnurb(Base *base, Nurb *nurb, int dt)
if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
- /* direction vectors for 3d curve paths */
- if(cu->flag & CU_3D) {
+ /* direction vectors for 3d curve paths
+ when at its lowest, dont render normals */
+ if(cu->flag & CU_3D && G.scene->editbutsize > 0.0015) {
BIF_ThemeColor(TH_WIRE);
for (bl=cu->bev.first,nu=nurb; nu && bl; bl=bl->next,nu=nu->next) {
BevPoint *bevp= (BevPoint *)(bl+1);
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c
index c167c7b0f7e..362dc15ed61 100644
--- a/source/blender/src/drawview.c
+++ b/source/blender/src/drawview.c
@@ -1660,7 +1660,7 @@ static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim)
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
while(a--) {
- if(bp->f1 & 1) {
+ if(bp->f1 & SELECT) {
VecAddf(median, median, bp->vec);
median[3]+= bp->vec[3];
totw++;
@@ -1832,7 +1832,7 @@ static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim)
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
while(a--) {
- if(bp->f1 & 1) {
+ if(bp->f1 & SELECT) {
VecAddf(bp->vec, bp->vec, median);
bp->vec[3]+= median[3];
bp->weight+= median[4];
@@ -2805,6 +2805,8 @@ static void draw_sculpt_depths(View3D *v3d)
}
}
+static void draw_viewport_fps(ScrArea *sa);
+
void drawview3dspace(ScrArea *sa, void *spacedata)
{
View3D *v3d= spacedata;
@@ -3082,8 +3084,12 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
draw_view_axis();
else
draw_view_icon();
- if(U.uiflag & USER_SHOW_VIEWPORTNAME)
+
+ if(U.uiflag & USER_SHOW_FPS && G.f & G_PLAYANIM) {
+ draw_viewport_fps(sa);
+ } else if(U.uiflag & USER_SHOW_VIEWPORTNAME) {
draw_viewport_name(sa);
+ }
ob= OBACT;
if(ob && (U.uiflag & USER_DRAWVIEWINFO))
@@ -3256,6 +3262,10 @@ static ScrArea *oldsa;
static double swaptime;
static int curmode;
+/* used for fps display */
+static double redrawtime;
+static double lredrawtime;
+
int update_time(void)
{
static double ltime;
@@ -3274,6 +3284,29 @@ int update_time(void)
return (tottime < 0.0);
}
+static void draw_viewport_fps(ScrArea *sa)
+{
+ char printable[16];
+ printable[0] = '\0';
+ float fps;
+ if (lredrawtime == redrawtime)
+ return;
+
+ fps = (float)(1.0/(lredrawtime-redrawtime));
+
+ /* is this more then half a frame behind? */
+ if (fps+0.5 < FPS) {
+ BIF_ThemeColor(TH_REDALERT);
+ sprintf(printable, "fps: %.2f", (float)fps);
+ } else {
+ BIF_ThemeColor(TH_TEXT_HI);
+ sprintf(printable, "fps: %i", (int)(fps+0.5));
+ }
+
+ glRasterPos2i(10, sa->winy-20);
+ BMF_DrawString(G.fonts, printable);
+}
+
static void inner_play_prefetch_frame(int mode, int cfra)
{
ScrArea *sa;
@@ -3388,6 +3421,9 @@ void inner_play_anim_loop(int init, int mode)
curmode= mode;
last_cfra = -1;
cached = cached_dynamics(PSFRA,PEFRA);
+
+ redrawtime = 1.0/FPS;
+ lredrawtime = 0.0;
return;
}
@@ -3523,7 +3559,10 @@ int play_anim(int mode)
screen_swapbuffers();
while(TRUE) {
-
+
+ if (U.uiflag & USER_SHOW_FPS)
+ lredrawtime = PIL_check_seconds_timer();
+
while(qtest()) {
/* we test events first because of MKEY event */
@@ -3549,8 +3588,13 @@ int play_anim(int mode)
if(ELEM3(event, ESCKEY, SPACEKEY, RIGHTMOUSE)) break;
inner_play_anim_loop(0, 0);
+
+
screen_swapbuffers();
-
+
+ if (U.uiflag & USER_SHOW_FPS)
+ redrawtime = lredrawtime;
+
if((mode & 2) && CFRA==PEFRA) break; /* no replay */
}
diff --git a/source/blender/src/edit.c b/source/blender/src/edit.c
index 2e4b89869c4..fcd38ef16a7 100644
--- a/source/blender/src/edit.c
+++ b/source/blender/src/edit.c
@@ -728,7 +728,7 @@ void countall()
a= nu->pntsu*nu->pntsv;
while(a--) {
G.totvert++;
- if(bp->f1 & 1) G.totvertsel++;
+ if(bp->f1 & SELECT) G.totvertsel++;
bp++;
}
}
@@ -752,7 +752,7 @@ void countall()
a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
while(a--) {
G.totvert++;
- if(bp->f1 & 1) G.totvertsel++;
+ if(bp->f1 & SELECT) G.totvertsel++;
bp++;
}
}
@@ -1109,12 +1109,12 @@ static void make_trans_verts(float *min, float *max, int mode)
bp= nu->bp;
while(a--) {
if(bp->hide==0) {
- if((mode & 1) || (bp->f1 & 1)) {
+ if((mode & 1) || (bp->f1 & SELECT)) {
VECCOPY(tv->oldloc, bp->vec);
tv->loc= bp->vec;
tv->val= &(bp->alfa);
tv->oldval= bp->alfa;
- tv->flag= bp->f1 & 1;
+ tv->flag= bp->f1 & SELECT;
tv++;
tottrans++;
}
@@ -1147,11 +1147,11 @@ static void make_trans_verts(float *min, float *max, int mode)
a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
while(a--) {
- if((mode & 1) || (bp->f1 & 1)) {
+ if((mode & 1) || (bp->f1 & SELECT)) {
if(bp->hide==0) {
VECCOPY(tv->oldloc, bp->vec);
tv->loc= bp->vec;
- tv->flag= bp->f1 & 1;
+ tv->flag= bp->f1 & SELECT;
tv++;
tottrans++;
}
diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c
index 25110a971e4..8d845c4ba14 100644
--- a/source/blender/src/editcurve.c
+++ b/source/blender/src/editcurve.c
@@ -207,7 +207,7 @@ int isNurbsel_count(Nurb *nu)
bezt= nu->bezt;
a= nu->pntsu;
while(a--) {
- if( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) sel++;
+ if (BEZSELECTED_HIDDENHANDLES(bezt)) sel++;
bezt++;
}
}
@@ -1341,9 +1341,9 @@ static void select_adjacent_cp(short next, short cont, short selstatus)
while(a--) {
if(a-abs(next) < 0) break;
sel=0;
- if((lastsel==0) && (bp->hide==0) && ((bp->f1 & 1) || (selstatus==0))) {
+ if((lastsel==0) && (bp->hide==0) && ((bp->f1 & SELECT) || (selstatus==0))) {
bp+=next;
- if(!(bp->f1 & 1) || (selstatus==0)) {
+ if(!(bp->f1 & SELECT) || (selstatus==0)) {
sel= select_bpoint(bp, selstatus, 1, VISIBLE);
if((sel==1) && (cont==0)) lastsel= 1;
}
@@ -1442,11 +1442,11 @@ void hideNurb(int swap)
a= nu->pntsu*nu->pntsv;
sel= 0;
while(a--) {
- if(swap==0 && (bp->f1 & 1)) {
+ if(swap==0 && (bp->f1 & SELECT)) {
select_bpoint(bp, DESELECT, 1, HIDDEN);
bp->hide= 1;
}
- else if(swap && (bp->f1 & 1)==0) {
+ else if(swap && (bp->f1 & SELECT)==0) {
select_bpoint(bp, DESELECT, 1, HIDDEN);
bp->hide= 1;
}
@@ -1666,7 +1666,7 @@ void subdivideNurb()
bp= prevbp+1;
}
while(a--) {
- if( (bp->f1 & 1) && (prevbp->f1 & 1) ) amount++;
+ if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) amount++;
prevbp= bp;
bp++;
}
@@ -1691,7 +1691,7 @@ void subdivideNurb()
memcpy(bpn, prevbp, sizeof(BPoint));
bpn++;
- if( (bp->f1 & 1) && (prevbp->f1 & 1) ) {
+ if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) {
// printf("*** subdivideNurb: insert 'linear' point\n");
memcpy(bpn, bp, sizeof(BPoint));
bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0;
@@ -1767,7 +1767,7 @@ void subdivideNurb()
bp= nu->bp;
for(a=0; a<nu->pntsv; a++) {
for(b=0; b<nu->pntsu; b++) {
- if(bp->f1 & 1) {
+ if(bp->f1 & SELECT) {
usel[b]++;
vsel[a]++;
sel++;
@@ -2237,7 +2237,7 @@ int is_u_selected(Nurb *nu, int u)
/* what about resolu == 2? */
bp= nu->bp+u;
for(v=0; v<nu->pntsv-1; v++, bp+=nu->pntsu) {
- if(v) if(bp->f1 & 1) return 1;
+ if(v) if(bp->f1 & SELECT) return 1;
}
return 0;
@@ -2516,7 +2516,7 @@ void addsegment_nurb()
if(isNurbsel_count(nu)==1) {
/* only 1 selected, not first or last, a little complex, but intuitive */
if(nu->pntsv==1) {
- if( (nu->bp->f1 & 1) || ((nu->bp+nu->pntsu-1)->f1 & 1));
+ if( (nu->bp->f1 & SELECT) || ((nu->bp+nu->pntsu-1)->f1 & SELECT));
else break;
}
}
@@ -2560,23 +2560,23 @@ void addsegment_nurb()
else if(nu->pntsv==1) {
bp= nu->bp;
if(nu1==0) {
- if( bp->f1 & 1) nu1= nu;
+ if( bp->f1 & SELECT) nu1= nu;
else {
bp= bp+(nu->pntsu-1);
- if( bp->f1 & 1 ) {
+ if( bp->f1 & SELECT ) {
nu1= nu;
switchdirectionNurb(nu);
}
}
}
else if(nu2==0) {
- if( bp->f1 & 1) {
+ if( bp->f1 & SELECT ) {
nu2= nu;
switchdirectionNurb(nu);
}
else {
bp= bp+(nu->pntsu-1);
- if( bp->f1 & 1 ) {
+ if( bp->f1 & SELECT ) {
nu2= nu;
}
}
@@ -2669,8 +2669,8 @@ void mouse_nurb()
if(bezt) {
if(hand==1) select_beztriple(bezt, SELECT, 1, HIDDEN);
- else if(hand==0) bezt->f1|= 1;
- else bezt->f3|= 1;
+ else if(hand==0) bezt->f1|= SELECT;
+ else bezt->f3|= SELECT;
}
else {
lastselbp= bp;
@@ -2978,10 +2978,7 @@ void extrude_nurb()
}
if(nu) {
addvert_Nurb('e');
- }
- else {
-
-
+ } else {
ok= extrudeflagNurb(1); /* '1'= flag */
if(ok) {
@@ -3011,7 +3008,7 @@ void makecyclicNurb()
a= nu->pntsu;
bp= nu->bp;
while(a--) {
- if( bp->f1 & 1 ) {
+ if( bp->f1 & SELECT ) {
if(nu->flagu & CU_CYCLIC) nu->flagu--;
else nu->flagu++;
break;
@@ -3036,7 +3033,7 @@ void makecyclicNurb()
a= nu->pntsu;
bp= nu->bp;
while(a--) {
- if( bp->f1 & 1 ) {
+ if( bp->f1 & SELECT ) {
if(nu->flagu & CU_CYCLIC) nu->flagu--;
else {
nu->flagu++;
@@ -3064,7 +3061,7 @@ void makecyclicNurb()
bp= nu->bp;
while(a--) {
- if( bp->f1 & 1) {
+ if( bp->f1 & SELECT) {
if(cyclmode==1 && nu->pntsu>1) {
if(nu->flagu & CU_CYCLIC) nu->flagu--;
else {
@@ -3154,7 +3151,7 @@ void selectrow_nurb()
for(v=0; v<nu->pntsv; v++) {
for(u=0; u<nu->pntsu; u++, bp++) {
if(bp==lastselbp) {
- if(bp->f1 & 1) {
+ if(bp->f1 & SELECT) {
ok= 1;
break;
}
@@ -3292,18 +3289,18 @@ void select_more_nurb()
bp= nu->bp;
selbpoints= MEM_callocN(sizeof(short)*a-nu->pntsu, "selectlist");
while(a > 0) {
- if((selbpoints[a]!=1) && (bp->hide==0) && (bp->f1 & 1)) {
+ if((selbpoints[a]!=1) && (bp->hide==0) && (bp->f1 & SELECT)) {
/* upper control point */
if(a%nu->pntsu != 0) {
tempbp= bp-1;
- if(!(tempbp->f1 & 1)) select_bpoint(tempbp, SELECT, 1, VISIBLE);
+ if(!(tempbp->f1 & SELECT)) select_bpoint(tempbp, SELECT, 1, VISIBLE);
}
/* left control point. select only if it is not selected already */
if(a-nu->pntsu > 0) {
sel= 0;
tempbp= bp+nu->pntsu;
- if(!(tempbp->f1 & 1)) sel= select_bpoint(tempbp, SELECT, 1, VISIBLE);
+ if(!(tempbp->f1 & SELECT)) sel= select_bpoint(tempbp, SELECT, 1, VISIBLE);
/* make sure selected bpoint is discarded */
if(sel == 1) selbpoints[a-nu->pntsu]= 1;
}
@@ -3311,7 +3308,7 @@ void select_more_nurb()
/* right control point */
if(a+nu->pntsu < nu->pntsu*nu->pntsv) {
tempbp= bp-nu->pntsu;
- if(!(tempbp->f1 & 1)) select_bpoint(tempbp, SELECT, 1, VISIBLE);
+ if(!(tempbp->f1 & SELECT)) select_bpoint(tempbp, SELECT, 1, VISIBLE);
}
/* lower control point. skip next bp in case selection was made */
@@ -3361,7 +3358,7 @@ void select_less_nurb()
bp= nu->bp;
selbpoints= MEM_callocN(sizeof(short)*a, "selectlist");
while(a--) {
- if((bp->hide==0) && (bp->f1 & 1)) {
+ if((bp->hide==0) && (bp->f1 & SELECT)) {
sel= 0;
/* check if neighbours have been selected */
@@ -3369,28 +3366,28 @@ void select_less_nurb()
if((a+1)%nu->pntsu==0) sel++;
else {
bp--;
- if((selbpoints[a+1]==1) || ((bp->hide==0) && (bp->f1 & 1))) sel++;
+ if((selbpoints[a+1]==1) || ((bp->hide==0) && (bp->f1 & SELECT))) sel++;
bp++;
}
if((a+1)%nu->pntsu==1) sel++;
else {
bp++;
- if((bp->hide==0) && (bp->f1 & 1)) sel++;
+ if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
bp--;
}
if(a+1 > nu->pntsu*nu->pntsv-nu->pntsu) sel++;
else {
bp-=nu->pntsu;
- if((selbpoints[a+nu->pntsu]==1) || ((bp->hide==0) && (bp->f1 & 1))) sel++;
+ if((selbpoints[a+nu->pntsu]==1) || ((bp->hide==0) && (bp->f1 & SELECT))) sel++;
bp+=nu->pntsu;
}
if(a < nu->pntsu) sel++;
else {
bp+=nu->pntsu;
- if((bp->hide==0) && (bp->f1 & 1)) sel++;
+ if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
bp-=nu->pntsu;
}
@@ -3450,7 +3447,7 @@ void select_less_nurb()
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
while(a--) {
- if((lastsel==0) && (bp->hide==0) && (bp->f1 & 1)) {
+ if((lastsel==0) && (bp->hide==0) && (bp->f1 & SELECT)) {
if(lastsel!=0) sel= 1;
else sel= 0;
@@ -3458,14 +3455,14 @@ void select_less_nurb()
if(a==nu->pntsu*nu->pntsv-1) sel++;
else {
bp--;
- if((bp->hide==0) && (bp->f1 & 1)) sel++;
+ if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
bp++;
}
if(a==0) sel++;
else {
bp++;
- if((bp->hide==0) && (bp->f1 & 1)) sel++;
+ if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
bp--;
}
@@ -3653,7 +3650,7 @@ void delNurb()
a= nu->pntsu*nu->pntsv;
if(a) {
while(a) {
- if(bp->f1 & 1 );
+ if(bp->f1 & SELECT);
else break;
a--;
bp++;
@@ -3695,7 +3692,7 @@ void delNurb()
bp= nu->bp;
for(a=0;a<nu->pntsu;a++) {
- if( bp->f1 & 1 ) {
+ if( bp->f1 & SELECT ) {
memcpy(bp, bp+1, (nu->pntsu-a-1)*sizeof(BPoint));
nu->pntsu--;
a--;
@@ -3754,7 +3751,7 @@ void delNurb()
else if(nu->pntsv==1) {
bp= nu->bp;
for(a=0; a<nu->pntsu-1; a++) {
- if( bp->f1 & 1 ) {
+ if( bp->f1 & SELECT ) {
bp1= bp;
bp2= bp+1;
if( bp2->f1 & 1 ) ;
@@ -4080,7 +4077,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
for(a=0;a<4;a++, bp++) {
VECCOPY(bp->vec, cent);
bp->vec[3]= 1.0;
- bp->f1= 1;
+ bp->f1= SELECT;
bp->radius = bp->weight = 1.0;
}
@@ -4117,7 +4114,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
for(a=0;a<5;a++, bp++) {
VECCOPY(bp->vec, cent);
bp->vec[3]= 1.0;
- bp->f1= 1;
+ bp->f1= SELECT;
bp->radius = bp->weight = 1.0;
}
@@ -4200,7 +4197,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
bp= nu->bp;
for(a=0; a<8; a++) {
- bp->f1= 1;
+ bp->f1= SELECT;
VECCOPY(bp->vec, cent);
if(xzproj==0) {
@@ -4242,7 +4239,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
for(a=0; a<4; a++) {
for(b=0; b<4; b++) {
VECCOPY(bp->vec, cent);
- bp->f1= 1;
+ bp->f1= SELECT;
fac= (float)a -1.5;
bp->vec[0]+= fac*grid;
fac= (float)b -1.5;
@@ -4286,7 +4283,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
while(a-- >0) {
- bp->f1 |= 1;
+ bp->f1 |= SELECT;
bp++;
}
}
@@ -4309,7 +4306,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
bp= nu->bp;
for(a=0; a<5; a++) {
- bp->f1= 1;
+ bp->f1= SELECT;
VECCOPY(bp->vec, cent);
bp->vec[0]+= nurbcircle[a][0]*grid;
bp->vec[2]+= nurbcircle[a][1]*grid;
@@ -4330,7 +4327,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
while(a-- >0) {
- bp->f1 |= 1;
+ bp->f1 |= SELECT;
bp++;
}
BLI_remlink(&editNurb, nu);
@@ -4358,7 +4355,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
a= nu->pntsu*nu->pntsv;
bp= nu->bp;
while(a-- >0) {
- bp->f1 |= 1;
+ bp->f1 |= SELECT;
bp++;
}
@@ -4541,7 +4538,7 @@ void clear_tilt()
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
while(a--) {
- if(bp->f1 & 1) bp->alfa= 0.0;
+ if(bp->f1 & SELECT) bp->alfa= 0.0;
bp++;
}
}
diff --git a/source/blender/src/editlattice.c b/source/blender/src/editlattice.c
index 9aa363a654f..f3073cf886a 100644
--- a/source/blender/src/editlattice.c
+++ b/source/blender/src/editlattice.c
@@ -240,7 +240,7 @@ static void findnearestLattvert__doClosest(void *userData, BPoint *bp, int x, in
struct { BPoint *bp; short dist, select, mval[2]; } *data = userData;
float temp = abs(data->mval[0]-x) + abs(data->mval[1]-y);
- if ((bp->f1&1)==data->select) temp += 5;
+ if ((bp->f1 & SELECT)==data->select) temp += 5;
if (temp<data->dist) {
data->dist = temp;
@@ -274,17 +274,13 @@ void mouse_lattice(void)
if((G.qual & LR_SHIFTKEY)==0) {
setflagsLatt(0);
- bp->f1 |= 1;
+ bp->f1 |= SELECT;
allqueue(REDRAWVIEW3D, 0);
}
else {
-
- if(bp->f1 & 1) bp->f1 &= ~1;
- else bp->f1 |= 1;
-
+ bp->f1 ^= SELECT; /* swap */
allqueue(REDRAWVIEW3D, 0);
-
}
countall();
diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c
index c5d7ce231c7..b3252487fa6 100644
--- a/source/blender/src/editview.c
+++ b/source/blender/src/editview.c
@@ -533,7 +533,7 @@ static void do_lasso_select_curve__doSelect(void *userData, Nurb *nu, BPoint *bp
if (lasso_inside(data->mcords, data->moves, x, y)) {
if (bp) {
- bp->f1 = data->select?(bp->f1|1):(bp->f1&~1);
+ bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
} else {
if (G.f & G_HIDDENHANDLES) {
/* can only be beztindex==0 here since handles are hidden */
@@ -566,7 +566,7 @@ static void do_lasso_select_lattice__doSelect(void *userData, BPoint *bp, int x,
struct { short (*mcords)[2]; short moves; short select; } *data = userData;
if (lasso_inside(data->mcords, data->moves, x, y)) {
- bp->f1 = data->select?(bp->f1|1):(bp->f1&~1);
+ bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
}
}
static void do_lasso_select_lattice(short mcords[][2], short moves, short select)
@@ -1599,7 +1599,7 @@ static void do_nurbs_box_select__doSelect(void *userData, Nurb *nu, BPoint *bp,
if (BLI_in_rcti(data->rect, x, y)) {
if (bp) {
- bp->f1 = data->select?(bp->f1|1):(bp->f1&~1);
+ bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
} else {
if (G.f & G_HIDDENHANDLES) {
/* can only be beztindex==0 here since handles are hidden */
@@ -1631,7 +1631,7 @@ static void do_lattice_box_select__doSelect(void *userData, BPoint *bp, int x, i
struct { rcti *rect; int select; } *data = userData;
if (BLI_in_rcti(data->rect, x, y)) {
- bp->f1 = data->select?(bp->f1|1):(bp->f1&~1);
+ bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
}
}
static void do_lattice_box_select(rcti *rect, int select)
@@ -2083,7 +2083,7 @@ static void latticecurve_selectionCB__doSelect(void *userData, BPoint *bp, int x
float r = sqrt(mx*mx + my*my);
if (r<=data->radius) {
- bp->f1 = data->select?(bp->f1|1):(bp->f1&~1);
+ bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
}
}
static void lattice_selectionCB(int selecting, Object *editobj, short *mval, float rad)
diff --git a/source/blender/src/retopo.c b/source/blender/src/retopo.c
index 4ef07b73061..287909da470 100644
--- a/source/blender/src/retopo.c
+++ b/source/blender/src/retopo.c
@@ -841,7 +841,7 @@ void retopo_do_all()
bp= nu->bp;
for(i=0; i<nu->pntsv; ++i) {
for(j=0; j<nu->pntsu; ++j, ++bp) {
- if(bp->f1 & 1)
+ if(bp->f1 & SELECT)
retopo_do_vert(G.vd,bp->vec);
}
}
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index af5e24ff865..b340af61cd2 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -3514,6 +3514,11 @@ void drawinfospace(ScrArea *sa, void *spacedata)
0, 0, 0, 0, 0, "");
}
+ uiDefButBitI(block, TOG, USER_SHOW_FPS, B_DRAWINFO, "Display FPS in View",
+ (xpos+edgsp+(3*mpref)+(4*midsp)),y2,mpref,buth,
+ &(U.uiflag), 0, 0, 0, 0,
+ "Display the number of frames per secons being drawn");
+
/* illegal combo... */
if (U.flag & USER_LMOUSESELECT)
U.flag &= ~USER_TWOBUTTONMOUSE;
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c
index 65a3329b2ed..c84109c54bb 100644
--- a/source/blender/src/transform_conversions.c
+++ b/source/blender/src/transform_conversions.c
@@ -1199,7 +1199,7 @@ static void createTransCurveVerts(TransInfo *t)
for(a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) {
if(bp->hide==0) {
if(propmode) count++;
- if(bp->f1 & 1) countsel++;
+ if(bp->f1 & SELECT) countsel++;
}
}
}
@@ -1314,11 +1314,11 @@ static void createTransCurveVerts(TransInfo *t)
head = tail = td;
for(a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) {
if(bp->hide==0) {
- if(propmode || (bp->f1 & 1)) {
+ if(propmode || (bp->f1 & SELECT)) {
VECCOPY(td->iloc, bp->vec);
td->loc= bp->vec;
VECCOPY(td->center, td->loc);
- if(bp->f1 & 1) td->flag= TD_SELECTED;
+ if(bp->f1 & SELECT) td->flag= TD_SELECTED;
else td->flag= 0;
td->ext = NULL;
td->tdi = NULL;
@@ -1365,7 +1365,7 @@ static void createTransLatticeVerts(TransInfo *t)
a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
while(a--) {
if(bp->hide==0) {
- if(bp->f1 & 1) countsel++;
+ if(bp->f1 & SELECT) countsel++;
if(propmode) count++;
}
bp++;
@@ -1385,12 +1385,12 @@ static void createTransLatticeVerts(TransInfo *t)
bp= editLatt->def;
a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
while(a--) {
- if(propmode || (bp->f1 & 1)) {
+ if(propmode || (bp->f1 & SELECT)) {
if(bp->hide==0) {
VECCOPY(td->iloc, bp->vec);
td->loc= bp->vec;
VECCOPY(td->center, td->loc);
- if(bp->f1 & 1) td->flag= TD_SELECTED;
+ if(bp->f1 & SELECT) td->flag= TD_SELECTED;
else td->flag= 0;
Mat3CpyMat3(td->smtx, smtx);
Mat3CpyMat3(td->mtx, mtx);
diff --git a/source/blender/src/transform_manipulator.c b/source/blender/src/transform_manipulator.c
index b0bcf6da297..7a6d4c69442 100644
--- a/source/blender/src/transform_manipulator.c
+++ b/source/blender/src/transform_manipulator.c
@@ -340,7 +340,7 @@ int calc_manipulator_stats(ScrArea *sa)
bp= nu->bp;
a= nu->pntsu*nu->pntsv;
while(a--) {
- if(bp->f1 & 1) {
+ if(bp->f1 & SELECT) {
calc_tw_center(bp->vec);
totsel++;
}
@@ -388,7 +388,7 @@ int calc_manipulator_stats(ScrArea *sa)
a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
while(a--) {
- if(bp->f1 & 1) {
+ if(bp->f1 & SELECT) {
calc_tw_center(bp->vec);
totsel++;
}