diff options
author | Mike Erwin <significant.bit@gmail.com> | 2015-03-30 09:53:39 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2015-03-30 09:53:39 +0300 |
commit | 786763ca4c10be726bc8293fd3bb93d7d019dbc6 (patch) | |
tree | 272043ca6475bed1ed0cd43e18474e843f015c77 /source/blender/editors/space_view3d | |
parent | e47a96463dad63e9d225a23fac1924cca00ed6ca (diff) |
remove zero translations
within draw_emtpy_*
These are no-ops.
Also const-ified some variables there.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index d11e1045d7f..628fd23e0d5 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -648,9 +648,6 @@ static void draw_empty_image(Object *ob, const short dflag, const unsigned char glMatrixMode(GL_MODELVIEW); glPushMatrix(); - /* Make sure we are drawing at the origin */ - glTranslatef(0.0f, 0.0f, 0.0f); - /* Calculate Image scale */ scale = (ob->empty_drawsize / max_ff((float)ima_x * sca_x, (float)ima_y * sca_y)); @@ -6431,15 +6428,13 @@ static void draw_empty_sphere(float size) /* draw a cone for use as an empty drawtype */ static void draw_empty_cone(float size) { - float cent = 0; - float radius; + const float radius = size; + GLUquadricObj *qobj = gluNewQuadric(); gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); glPushMatrix(); - radius = size; - glTranslatef(cent, cent, cent); glScalef(radius, size * 2.0f, radius); glRotatef(-90.0, 1.0, 0.0, 0.0); gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1); @@ -6668,11 +6663,8 @@ static void draw_forcefield(Object *ob, RegionView3D *rv3d, PartDeflect *pd = ob->pd; float imat[4][4], tmat[4][4]; float vec[3] = {0.0, 0.0, 0.0}; - float size; - /* scale size of circle etc with the empty drawsize */ - if (ob->type == OB_EMPTY) size = ob->empty_drawsize; - else size = 1.0; + const float size = (ob->type == OB_EMPTY) ? ob->empty_drawsize : 1.0f; /* calculus here, is reused in PFIELD_FORCE */ invert_m4_m4(imat, rv3d->viewmatob); |