use best GPU matrix function for the job
Follow-up to 204e067111
which coverted manipulators' legacy GL matrix calls to new ones.
part of T49450
This commit is contained in:
@@ -76,11 +76,11 @@ static void arrow2d_draw_geom(ArrowManipulator2D *arrow, const float origin[2])
|
|||||||
const float draw_line_ofs = (arrow->manipulator.line_width * 0.5f) / arrow->manipulator.scale;
|
const float draw_line_ofs = (arrow->manipulator.line_width * 0.5f) / arrow->manipulator.scale;
|
||||||
|
|
||||||
gpuPushMatrix();
|
gpuPushMatrix();
|
||||||
gpuTranslate3f(UNPACK2(origin), 0.0f);
|
gpuTranslate2fv(origin);
|
||||||
gpuScale3f(arrow->manipulator.scale, arrow->manipulator.scale, 0.0f);
|
gpuScaleUniform(arrow->manipulator.scale);
|
||||||
gpuRotate3f(RAD2DEGF(arrow->angle), 0.0f, 0.0f, 1.0f);
|
gpuRotate2D(RAD2DEGF(arrow->angle));
|
||||||
/* local offset */
|
/* local offset */
|
||||||
gpuTranslate3f(arrow->manipulator.offset[0] + draw_line_ofs, arrow->manipulator.offset[1], 0.0f);
|
gpuTranslate2f(arrow->manipulator.offset[0] + draw_line_ofs, arrow->manipulator.offset[1]);
|
||||||
|
|
||||||
/* TODO get rid of immediate mode */
|
/* TODO get rid of immediate mode */
|
||||||
glBegin(GL_LINES);
|
glBegin(GL_LINES);
|
||||||
|
@@ -190,12 +190,12 @@ static void manipulator_rect_transform_draw(const bContext *UNUSED(C), wmManipul
|
|||||||
r.ymax = half_h;
|
r.ymax = half_h;
|
||||||
|
|
||||||
gpuPushMatrix();
|
gpuPushMatrix();
|
||||||
gpuTranslate3f(manipulator->origin[0] + manipulator->offset[0],
|
gpuTranslate2f(manipulator->origin[0] + manipulator->offset[0],
|
||||||
manipulator->origin[1] + manipulator->offset[1], 0.0f);
|
manipulator->origin[1] + manipulator->offset[1]);
|
||||||
if (cage->style & MANIPULATOR_RECT_TRANSFORM_STYLE_SCALE_UNIFORM)
|
if (cage->style & MANIPULATOR_RECT_TRANSFORM_STYLE_SCALE_UNIFORM)
|
||||||
gpuScale3f(cage->scale[0], cage->scale[0], 1.0);
|
gpuScaleUniform(cage->scale[0]);
|
||||||
else
|
else
|
||||||
gpuScale3f(cage->scale[0], cage->scale[1], 1.0);
|
gpuScale2fv(cage->scale);
|
||||||
|
|
||||||
if (w > h)
|
if (w > h)
|
||||||
aspx = h / w;
|
aspx = h / w;
|
||||||
|
@@ -149,7 +149,7 @@ static void manipulator_primitive_draw_intern(
|
|||||||
gpuMultMatrix3D(mat);
|
gpuMultMatrix3D(mat);
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
gpuTranslate3f(UNPACK3(prim->manipulator.offset));
|
gpuTranslate3fv(prim->manipulator.offset);
|
||||||
manipulator_primitive_draw_geom(col_inner, col_outer, prim->style);
|
manipulator_primitive_draw_geom(col_inner, col_outer, prim->style);
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user