changeset 25951:9b51f2ba368b

Support alpha for vo gl osdcolor
author reimar
date Mon, 11 Feb 2008 19:00:01 +0000
parents 80c8977f4d8a
children bb89f92affff
files libvo/vo_gl.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_gl.c	Mon Feb 11 15:23:21 2008 +0000
+++ b/libvo/vo_gl.c	Mon Feb 11 19:00:01 2008 +0000
@@ -544,7 +544,7 @@
   // 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 @@
       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