* selecting objects has a different frontbuffer drawing handling now.
instead of drawing everything again, in all windows, it restricts to the active and previous active object. when there are more objects to be redrawn, it does a normal swapbuffers. Result is it all redraws & selects a lot faster in complex scenes * Little fix in "BallTable" routine when moving mouse vertical out of the 3d window.
This commit is contained in:
@@ -241,8 +241,9 @@ static void draw_icon_centered(float *pos, unsigned int *rect, int rectsize)
|
||||
|
||||
/* use bitmap to shift rasterpos in pixels */
|
||||
glBitmap(0, 0, 0.0, 0.0, -hsize, -hsize, &dummy);
|
||||
glFinish(); /* for sun */
|
||||
|
||||
#ifdef __sun__
|
||||
glFinish();
|
||||
#endif
|
||||
glDrawPixels(rectsize, rectsize, GL_RGBA, GL_UNSIGNED_BYTE, rect);
|
||||
}
|
||||
|
||||
@@ -2113,7 +2114,7 @@ static void drawDispList(Object *ob, int dt)
|
||||
MFace *curface;
|
||||
int i;
|
||||
unsigned char r,g,b;
|
||||
float val1,val2,val3,val4;
|
||||
float val1,val2,val3,val4=0;
|
||||
|
||||
wtcol = curwt= MEM_callocN (sizeof (unsigned char) * me->totface*4*4, "weightmap");
|
||||
|
||||
@@ -3646,7 +3647,7 @@ void draw_object_ext(Base *base)
|
||||
ScrArea *tempsa, *sa;
|
||||
View3D *vd;
|
||||
|
||||
if(G.vd==0) return;
|
||||
if(G.vd==NULL || base==NULL) return;
|
||||
|
||||
if(G.vd->drawtype > OB_WIRE) {
|
||||
G.zbuf= 1;
|
||||
@@ -3679,7 +3680,6 @@ void draw_object_ext(Base *base)
|
||||
|
||||
G.f &= ~G_DRAW_EXT;
|
||||
|
||||
glFinish();
|
||||
glDrawBuffer(GL_BACK);
|
||||
|
||||
if(G.zbuf) {
|
||||
|
@@ -379,22 +379,23 @@ void deselectall(void) /* is toggle */
|
||||
|
||||
}
|
||||
|
||||
static void deselectall_ex(Base *b) /* deselect all except b */
|
||||
static void deselectall_except(Base *b) /* deselect all except b */
|
||||
{
|
||||
Base *base;
|
||||
int redraw=0;
|
||||
|
||||
base= FIRSTBASE;
|
||||
while(base) {
|
||||
if (base->flag & SELECT) {
|
||||
if(b!=base) {
|
||||
|
||||
base->flag &= ~SELECT;
|
||||
base->object->flag= base->flag;
|
||||
draw_object_ext(base); /* this test for layer */
|
||||
redraw= 1;
|
||||
}
|
||||
}
|
||||
base= base->next;
|
||||
}
|
||||
if(redraw) allqueue(REDRAWVIEW3D, 0);
|
||||
countall();
|
||||
}
|
||||
|
||||
@@ -484,7 +485,7 @@ void set_active_object(Object *ob)
|
||||
|
||||
void mouse_select(void)
|
||||
{
|
||||
Base *base, *startbase=0, *basact=0, *oldbasact;
|
||||
Base *base, *startbase=NULL, *basact=NULL, *oldbasact=NULL;
|
||||
unsigned int buffer[MAXPICKBUF];
|
||||
int temp, a, dist=100;
|
||||
short hits, mval[2];
|
||||
@@ -547,7 +548,7 @@ void mouse_select(void)
|
||||
if(basact) {
|
||||
if(G.obedit) {
|
||||
/* only do select */
|
||||
deselectall_ex(BASACT);
|
||||
deselectall_except(BASACT);
|
||||
basact->flag |= SELECT;
|
||||
draw_object_ext(basact);
|
||||
}
|
||||
@@ -556,12 +557,10 @@ void mouse_select(void)
|
||||
BASACT= basact;
|
||||
|
||||
if((G.qual & LR_SHIFTKEY)==0) {
|
||||
deselectall_ex(basact);
|
||||
deselectall_except(basact);
|
||||
basact->flag |= SELECT;
|
||||
}
|
||||
else {
|
||||
if(oldbasact) if(oldbasact != basact) draw_object_ext(oldbasact);
|
||||
|
||||
if(basact->flag & SELECT) {
|
||||
if(basact==oldbasact)
|
||||
basact->flag &= ~SELECT;
|
||||
@@ -569,15 +568,15 @@ void mouse_select(void)
|
||||
else basact->flag |= SELECT;
|
||||
}
|
||||
|
||||
/* if((basact->flag & SELECT)==0) BASACT= 0; */
|
||||
// copy
|
||||
basact->object->flag= basact->flag;
|
||||
|
||||
// for visual speed
|
||||
if(oldbasact != basact) draw_object_ext(oldbasact);
|
||||
draw_object_ext(basact);
|
||||
|
||||
if(oldbasact != basact) {
|
||||
|
||||
set_active_base(basact);
|
||||
|
||||
}
|
||||
|
||||
if(basact->object->type!=OB_MESH) {
|
||||
@@ -600,6 +599,8 @@ void mouse_select(void)
|
||||
allqueue(REDRAWHEADERS, 0); /* To force display update for the posebutton */
|
||||
}
|
||||
|
||||
glFinish(); /* reveil frontbuffer drawing */
|
||||
|
||||
}
|
||||
|
||||
countall();
|
||||
|
@@ -453,6 +453,7 @@ void viewmove(int mode)
|
||||
si= sqrt(dvec[0]*dvec[0]+ dvec[1]*dvec[1]+ dvec[2]*dvec[2]);
|
||||
si/= (2.0*TRACKBALLSIZE);
|
||||
|
||||
/* is there an acceptable solution? (180 degrees limitor) */
|
||||
if(si<1.0) {
|
||||
Crossf(q1+1, firstvec, newvec);
|
||||
|
||||
@@ -467,20 +468,20 @@ void viewmove(int mode)
|
||||
q1[3]*= si;
|
||||
|
||||
QuatMul(G.vd->viewquat, q1, oldquat);
|
||||
}
|
||||
|
||||
if( (U.flag & TRACKBALL)==0 ) {
|
||||
if( (U.flag & TRACKBALL)==0 ) {
|
||||
|
||||
/* rotate around z-axis (mouse x moves) */
|
||||
/* rotate around z-axis (mouse x moves) */
|
||||
|
||||
phi= 2*(mval[0]-mvalball[0]);
|
||||
phi/= (float)curarea->winx;
|
||||
si= sin(phi);
|
||||
q1[0]= cos(phi);
|
||||
q1[1]= q1[2]= 0.0;
|
||||
q1[3]= si;
|
||||
phi= 2*(mval[0]-mvalball[0]);
|
||||
phi/= (float)curarea->winx;
|
||||
si= sin(phi);
|
||||
q1[0]= cos(phi);
|
||||
q1[1]= q1[2]= 0.0;
|
||||
q1[3]= si;
|
||||
|
||||
QuatMul(G.vd->viewquat, G.vd->viewquat, q1);
|
||||
QuatMul(G.vd->viewquat, G.vd->viewquat, q1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(mode==1) { /* translate */
|
||||
|
Reference in New Issue
Block a user