less weird OSD alpha transformation.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16273 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-08-19 12:23:34 +00:00
parent f37f504f2a
commit 77ec0f850d
1 changed files with 4 additions and 2 deletions

View File

@ -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);