[MPlayer-cvslog] r33216 - in trunk/gui: mplayer/gui_common.c mplayer/menu.c skin/font.c skin/skin.c util/bitmap.c util/bitmap.h

ib subversion at mplayerhq.hu
Mon Apr 4 21:12:32 CEST 2011


Author: ib
Date: Mon Apr  4 21:12:31 2011
New Revision: 33216

Log:
Define the transparent color as a macro.

Additionally, remove it as parameter from Convert32to1(),
because there is only this single one.

Modified:
   trunk/gui/mplayer/gui_common.c
   trunk/gui/mplayer/menu.c
   trunk/gui/skin/font.c
   trunk/gui/skin/skin.c
   trunk/gui/util/bitmap.c
   trunk/gui/util/bitmap.h

Modified: trunk/gui/mplayer/gui_common.c
==============================================================================
--- trunk/gui/mplayer/gui_common.c	Mon Apr  4 20:51:06 2011	(r33215)
+++ trunk/gui/mplayer/gui_common.c	Mon Apr  4 21:12:31 2011	(r33216)
@@ -331,7 +331,7 @@ static void PutImage(txSample *bf, int x
         for (ix = x; ix < (int)(x + bf->Width); ix++) {
             tmp = drw[i++];
 
-            if (tmp != 0x00ff00ff)
+            if (tmp != TRANSPARENT)
                 buf[iy * image_width + ix] = tmp;
         }
 #else
@@ -341,7 +341,7 @@ static void PutImage(txSample *bf, int x
         for (ix = x; ix < (int)(x + bf->Width); ix++) {
             tmp = drw[i++];
 
-            if (tmp != 0x00ff00ff)
+            if (tmp != TRANSPARENT)
                 buf[yc + ix] = tmp;
         }
 
@@ -369,7 +369,7 @@ static void SimplePotmeterPutImage(txSam
         for (ix = x; ix < (int)(x + w); ix++) {
             tmp = drw[i++];
 
-            if (tmp != 0x00ff00ff)
+            if (tmp != TRANSPARENT)
                 buf[iy * image_width + ix] = tmp;
         }
 

Modified: trunk/gui/mplayer/menu.c
==============================================================================
--- trunk/gui/mplayer/menu.c	Mon Apr  4 20:51:06 2011	(r33215)
+++ trunk/gui/mplayer/menu.c	Mon Apr  4 21:12:31 2011	(r33216)
@@ -56,7 +56,7 @@ static void mplMenuDraw( void )
        for ( x=appMPlayer.menuItems[ mplMenuItem ].x; x < appMPlayer.menuItems[ mplMenuItem ].x + appMPlayer.menuItems[ mplMenuItem ].width; x++ )
          {
           tmp=drw[ y * appMPlayer.menuSelected.width + x ];
-          if ( tmp != 0x00ff00ff ) buf[ y * appMPlayer.menu.width + x ]=tmp;
+          if ( tmp != TRANSPARENT ) buf[ y * appMPlayer.menu.width + x ]=tmp;
          }
     }
    mplOldMenuItem=mplMenuItem;

Modified: trunk/gui/skin/font.c
==============================================================================
--- trunk/gui/skin/font.c	Mon Apr  4 20:51:06 2011	(r33215)
+++ trunk/gui/skin/font.c	Mon Apr  4 21:12:31 2011	(r33216)
@@ -306,7 +306,7 @@ txSample *fntRender(wItem *item, int px,
     ibuf = (uint32_t *)Fonts[id]->Bitmap.Image;
 
     for (i = 0; i < item->Bitmap.ImageSize / 4; i++)
-        obuf[i] = 0x00ff00ff;
+        obuf[i] = TRANSPARENT;
 
     if (tw <= iw) {
         switch (item->align) {

Modified: trunk/gui/skin/skin.c
==============================================================================
--- trunk/gui/skin/skin.c	Mon Apr  4 20:51:06 2011	(r33215)
+++ trunk/gui/skin/skin.c	Mon Apr  4 21:12:31 2011	(r33216)
@@ -277,7 +277,7 @@ static int item_base(char *in)
 
     if (!is_sub) {
 #ifdef CONFIG_XSHAPE
-        if (!Convert32to1(&currWin->Bitmap, &currWin->Mask, 0x00ff00ff)) {
+        if (!Convert32to1(&currWin->Bitmap, &currWin->Mask)) {
             skin_error(MSGTR_SKIN_NotEnoughMemory);
             return 1;
         }

Modified: trunk/gui/util/bitmap.c
==============================================================================
--- trunk/gui/util/bitmap.c	Mon Apr  4 20:51:06 2011	(r33215)
+++ trunk/gui/util/bitmap.c	Mon Apr  4 21:12:31 2011	(r33216)
@@ -216,7 +216,7 @@ void bpFree(txSample *bf)
     memset(bf, 0, sizeof(*bf));
 }
 
-int Convert32to1(txSample *in, txSample *out, uint32_t transparent)
+int Convert32to1(txSample *in, txSample *out)
 {
     uint32_t *buf;
     unsigned long i;
@@ -240,7 +240,7 @@ int Convert32to1(txSample *in, txSample 
     for (i = 0; i < out->Width * out->Height; i++) {
         tmp >>= 1;
 
-        if (buf[i] != transparent)
+        if (buf[i] != TRANSPARENT)
             tmp |= 0x80;
         else {
             buf[i] = 0;

Modified: trunk/gui/util/bitmap.h
==============================================================================
--- trunk/gui/util/bitmap.h	Mon Apr  4 20:51:06 2011	(r33215)
+++ trunk/gui/util/bitmap.h	Mon Apr  4 21:12:31 2011	(r33216)
@@ -19,7 +19,7 @@
 #ifndef MPLAYER_GUI_BITMAP_H
 #define MPLAYER_GUI_BITMAP_H
 
-#include <stdint.h>
+#define TRANSPARENT 0x00ff00ff   // transparent color (fuchsia/magenta)
 
 typedef struct {
     unsigned long Width;
@@ -31,6 +31,6 @@ typedef struct {
 
 void bpFree(txSample *bf);
 int bpRead(char *fname, txSample *bf);
-int Convert32to1(txSample *in, txSample *out, uint32_t transparent);
+int Convert32to1(txSample *in, txSample *out);
 
 #endif /* MPLAYER_GUI_BITMAP_H */


More information about the MPlayer-cvslog mailing list