[MPlayer-cvslog] r35539 - trunk/libvo/vo_gl.c

reimar subversion at mplayerhq.hu
Fri Nov 30 21:51:02 CET 2012


Author: reimar
Date: Fri Nov 30 21:51:02 2012
New Revision: 35539

Log:
Fix alpha for ASS subtitles.

EOSD always needs to use MODULATE since the vertex colour
might contain alpha.

Modified:
   trunk/libvo/vo_gl.c

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Fri Nov 30 21:11:58 2012	(r35538)
+++ trunk/libvo/vo_gl.c	Fri Nov 30 21:51:02 2012	(r35539)
@@ -824,14 +824,16 @@ static void do_render_osd(int type) {
     mpglPushMatrix();
     mpglLoadMatrixf(matrix);
   }
-  if (osd_color != 0xffffff)
-    mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
   mpglEnable(GL_BLEND);
   if (draw_eosd) {
+    mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
     mpglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     mpglCallList(eosdDispList);
+    mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
   }
   if (draw_osd) {
+    if (osd_color != 0xffffff)
+      mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
     mpglColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24));
     // draw OSD
 #ifndef FAST_OSD
@@ -850,11 +852,11 @@ static void do_render_osd(int type) {
       mpglBindTexture(gl_target, osdtex[i]);
       glDrawTex(c->x, c->y, c->w, c->h, 0, 0, c->w, c->h, c->sx, c->sy, using_tex_rect, 0, 0, 0);
     }
+    if (osd_color != 0xffffff)
+      mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
   }
   // set rendering parameters back to defaults
   mpglDisable(GL_BLEND);
-  if (osd_color != 0xffffff)
-    mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
   if (!scaled_osd)
     mpglPopMatrix();
   mpglBindTexture(gl_target, 0);


More information about the MPlayer-cvslog mailing list