vo_opengl: minor simplification

The extra gl_transform_trans() has no apparent use.
This commit is contained in:
wm4 2016-10-01 16:12:03 +02:00
parent 82231fd74d
commit 486b3ce6f8
1 changed files with 3 additions and 4 deletions

View File

@ -732,16 +732,15 @@ static int pass_bind(struct gl_video *p, struct img_tex tex)
static void get_transform(float w, float h, int rotate, bool flip,
struct gl_transform *out_tr)
{
struct gl_transform tr = identity_trans;
int a = rotate % 90 ? 0 : rotate / 90;
int sin90[4] = {0, 1, 0, -1}; // just to avoid rounding issues etc.
int cos90[4] = {1, 0, -1, 0};
struct gl_transform rot = {{{cos90[a], sin90[a]}, {-sin90[a], cos90[a]}}};
gl_transform_trans(rot, &tr);
struct gl_transform tr = {{{ cos90[a], sin90[a]},
{-sin90[a], cos90[a]}}};
// basically, recenter to keep the whole image in view
float b[2] = {1, 1};
gl_transform_vec(rot, &b[0], &b[1]);
gl_transform_vec(tr, &b[0], &b[1]);
tr.t[0] += b[0] < 0 ? w : 0;
tr.t[1] += b[1] < 0 ? h : 0;