Fix [#37319] Forcefield on translated, unselected lamp draws in origin.

drawlamp() was not resetting OGL matrix to its org value!

Thanks to Philipp Oeser for initial investigation, and Brecht for review. :)
This commit is contained in:
Bastien Montagne 2013-11-05 15:53:55 +00:00
parent 37f45454d3
commit c215faf9f4
1 changed files with 3 additions and 1 deletions

View File

@ -1356,6 +1356,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
}
/* and back to viewspace */
glPushMatrix();
glLoadMatrixf(rv3d->viewmat);
copy_v3_v3(vec, ob->obmat[3]);
@ -1391,6 +1392,8 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
/* restore for drawing extra stuff */
glColor3ubv(ob_wire_col);
}
/* and finally back to org object space! */
glPopMatrix();
}
static void draw_limit_line(float sta, float end, const short dflag, unsigned int col)
@ -6876,7 +6879,6 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
case OB_LAMP:
if (!render_override) {
drawlamp(scene, v3d, rv3d, base, dt, dflag, ob_wire_col);
if (dtx || (base->flag & SELECT)) glMultMatrixf(ob->obmat);
}
break;
case OB_CAMERA: