From 2d79c4c10923b2395cd59a7c5cc0fbb20dfb0419 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 11 Feb 2008 19:00:01 +0000 Subject: [PATCH] Support alpha for vo gl osdcolor git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25983 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index f61239eaec..fb8ad7e50f 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -544,7 +544,7 @@ static void create_osd_texture(int x0, int y0, int w, int h, // convert alpha from weird MPlayer scale. // in-place is not possible since it is reused for future OSDs for (i = h * stride - 1; i >= 0; i--) - tmp[i] = srca[i] - 1; + tmp[i] = -srca[i]; glUploadTex(gl_target, GL_ALPHA, GL_UNSIGNED_BYTE, tmp, stride, 0, 0, w, h, 0); free(tmp); @@ -615,13 +615,13 @@ flip_page(void) glCallList(eosdDispList); } if (osdtexCnt > 0) { - glColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff); + glColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24)); // draw OSD #ifndef FAST_OSD - glBlendFunc(GL_ZERO, GL_SRC_ALPHA); + glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA); glCallLists(osdtexCnt, GL_UNSIGNED_INT, osdaDispList); #endif - glBlendFunc(GL_ONE, GL_ONE); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); glCallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList); } // set rendering parameters back to defaults