From 77ec0f850d1e096ca72dab0675da62bcfb11845f Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 19 Aug 2005 12:23:34 +0000 Subject: [PATCH] less weird OSD alpha transformation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16273 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 775d7333c0..f0b9d311c8 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -331,8 +331,10 @@ static void create_osd_texture(int x0, int y0, int w, int h, { int i; char *tmp = (char *)malloc(stride * h); - for (i = 0; i < h * stride; i++) - tmp[i] = ~(-srca[i]); + // convert alpha from weird MPlayer scale. + // in-place is not possible since it is reused for future OSDs + for (i = h * stride; i; i--) + tmp[i] = srca[i] - 1; glUploadTex(gl_target, GL_ALPHA, GL_UNSIGNED_BYTE, tmp, stride, 0, 0, w, h, 0); free(tmp);