Fix for bug #17829: with ATI drivers, GLSL shadows crashed on physics
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 17 Oct 2008 13:36:40 +0000 (13:36 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 17 Oct 2008 13:36:40 +0000 (13:36 +0000)
'show pivot' drawing in the viewport. Also added checks for some other
cases where this could happen.

source/blender/src/drawobject.c

index 7ff7b20b3ea953c84e653e48b3befda61f534c88..551ce874db8abb4e2e0ab6cd5a182bcf2fc91e63 100644 (file)
@@ -3400,7 +3400,7 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys, int dt)
                                }
                                if(next_pa)
                                                continue;
-                               if(part->draw&PART_DRAW_NUM){
+                               if(part->draw&PART_DRAW_NUM && !(G.f & G_RENDER_SHADOW)){
                                        /* in path drawing state.co is the end point */
                                        glRasterPos3f(state.co[0],  state.co[1],  state.co[2]);
                                        sprintf(val," %i",a);
@@ -3709,7 +3709,7 @@ static void draw_particle_edit(Object *ob, ParticleSystem *psys, int dt)
                                }
                                cd += (timed?4:3) * pa->totkey;
 
-                               if(pset->flag&PE_SHOW_TIME && (pa->flag&PARS_HIDE)==0){
+                               if((pset->flag&PE_SHOW_TIME) && (pa->flag&PARS_HIDE)==0 && !(G.f & G_RENDER_SHADOW)){
                                        for(k=0, key=edit->keys[i]+k; k<pa->totkey; k++, key++){
                                                if(key->flag & PEK_HIDE) continue;
 
@@ -3736,7 +3736,7 @@ static void draw_particle_edit(Object *ob, ParticleSystem *psys, int dt)
                                        glVertex3fv(key->world_co);
                                        glEnd();
 
-                                       if(pset->flag & PE_SHOW_TIME){
+                                       if((pset->flag & PE_SHOW_TIME) && !(G.f & G_RENDER_SHADOW)){
                                                glRasterPos3fv(key->world_co);
                                                sprintf(val," %.1f",*key->time);
                                                BMF_DrawString(G.font, val);
@@ -4326,6 +4326,9 @@ static void draw_forcefield(Object *ob)
        float vec[3]= {0.0, 0.0, 0.0};
        int curcol;
        float size;
+
+       if(G.f & G_RENDER_SHADOW)
+               return;
        
        if(ob!=G.obedit && (ob->flag & SELECT)) {
                if(ob==OBACT) curcol= TH_ACTIVE;
@@ -4732,17 +4735,18 @@ static void draw_hooks(Object *ob)
        }
 }
 
-
 //<rcruiz>
-void drawRBpivot(bRigidBodyJointConstraint *data){
+void drawRBpivot(bRigidBodyJointConstraint *data)
+{
        float radsPerDeg = 6.283185307179586232f / 360.f;
        int axis;
        float v1[3]= {data->pivX, data->pivY, data->pivZ};
        float eu[3]= {radsPerDeg*data->axX, radsPerDeg*data->axY, radsPerDeg*data->axZ};
-       
+       float mat[4][4];
 
+       if(G.f & G_RENDER_SHADOW)
+               return;
 
-       float mat[4][4];
        EulToMat4(eu,mat);
        glLineWidth (4.0f);
        setlinestyle(2);