[MPlayer-cvslog] CVS: main/libmenu menu.c, 1.15, 1.16 menu.h, 1.3, 1.4 menu_list.h, 1.3, 1.4

Alban Bedel CVS syncmail at mplayerhq.hu
Sat Apr 22 18:22:35 CEST 2006


CVS change done by Alban Bedel CVS

Update of /cvsroot/mplayer/main/libmenu
In directory mail:/var2/tmp/cvs-serv25059/libmenu

Modified Files:
	menu.c menu.h menu_list.h 
Log Message:
Fix menu background drawing.


Index: menu.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmenu/menu.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- menu.c	30 Mar 2006 06:40:58 -0000	1.15
+++ menu.c	22 Apr 2006 16:22:32 -0000	1.16
@@ -563,11 +563,12 @@
 }
 
 
-void menu_draw_box(mp_image_t* mpi, char grey, char alpha, int x, int y, int w, int h) {
+void menu_draw_box(mp_image_t* mpi,unsigned char grey,unsigned char alpha, int x, int y, int w, int h) {
   draw_alpha_f draw_alpha = get_draw_alpha(mpi->imgfmt);
+  int g;
   
   if(!draw_alpha) {
-    printf("Unsupported outformat !!!!\n");
+    mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnsupportedOutformat);
     return;
   }
   
@@ -577,11 +578,14 @@
   if(x+w > mpi->w) w = mpi->w-x;
   if(y < 0) h += y, y = 0;
   if(y+h > mpi->h) h = mpi->h-y;
-  
+    
+  g = ((256-alpha)*grey)>>8;
+  if(g < 1) g = 1;
+    
   {
     int stride = (w+7)&(~7); // round to 8
     char pic[stride*h],pic_alpha[stride*h];
-    memset(pic,grey,stride*h);
+    memset(pic,g,stride*h);
     memset(pic_alpha,alpha,stride*h);
     draw_alpha(w,h,pic,pic_alpha,stride,
                mpi->planes[0] + y * mpi->stride[0] + x * (mpi->bpp>>3),

Index: menu.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmenu/menu.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- menu.h	30 Mar 2006 02:52:54 -0000	1.3
+++ menu.h	22 Apr 2006 16:22:33 -0000	1.4
@@ -73,4 +73,4 @@
 			 int x, int y,int w, int h,
 			 int vspace, int warp, int align, int anchor);
 
-void menu_draw_box(mp_image_t* mpi, char grey, char alpha, int x, int y, int w, int h);
+void menu_draw_box(mp_image_t* mpi, unsigned char grey, unsigned char alpha, int x, int y, int w, int h);

Index: menu_list.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmenu/menu_list.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- menu_list.h	30 Mar 2006 02:52:54 -0000	1.3
+++ menu_list.h	22 Apr 2006 16:22:33 -0000	1.4
@@ -56,9 +56,9 @@
   0,0, \
   5, 3, \
   NULL, \
-  0x80, 0x80, \
-  0x40, 0x80, \
-  0x70, 0x80 \
+  0xE0, 0x20, \
+  0x80, 0x50, \
+  0xC0, 0x50 \
 }
   
 




More information about the MPlayer-cvslog mailing list