changeset 33129:5f3171d4d7a4

Define the transparent color as a macro. Additionally, remove it as parameter from Convert32to1(), because there is only this single one.
author ib
date Mon, 04 Apr 2011 19:12:31 +0000
parents 64d19aaf624a
children 4f60cd16ac04
files gui/mplayer/gui_common.c gui/mplayer/menu.c gui/skin/font.c gui/skin/skin.c gui/util/bitmap.c gui/util/bitmap.h
diffstat 6 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/gui/mplayer/gui_common.c	Mon Apr 04 18:51:06 2011 +0000
+++ b/gui/mplayer/gui_common.c	Mon Apr 04 19:12:31 2011 +0000
@@ -331,7 +331,7 @@
         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 @@
         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 @@
         for (ix = x; ix < (int)(x + w); ix++) {
             tmp = drw[i++];
 
-            if (tmp != 0x00ff00ff)
+            if (tmp != TRANSPARENT)
                 buf[iy * image_width + ix] = tmp;
         }
 
--- a/gui/mplayer/menu.c	Mon Apr 04 18:51:06 2011 +0000
+++ b/gui/mplayer/menu.c	Mon Apr 04 19:12:31 2011 +0000
@@ -56,7 +56,7 @@
        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;
--- a/gui/skin/font.c	Mon Apr 04 18:51:06 2011 +0000
+++ b/gui/skin/font.c	Mon Apr 04 19:12:31 2011 +0000
@@ -306,7 +306,7 @@
     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) {
--- a/gui/skin/skin.c	Mon Apr 04 18:51:06 2011 +0000
+++ b/gui/skin/skin.c	Mon Apr 04 19:12:31 2011 +0000
@@ -277,7 +277,7 @@
 
     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;
         }
--- a/gui/util/bitmap.c	Mon Apr 04 18:51:06 2011 +0000
+++ b/gui/util/bitmap.c	Mon Apr 04 19:12:31 2011 +0000
@@ -216,7 +216,7 @@
     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 @@
     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;
--- a/gui/util/bitmap.h	Mon Apr 04 18:51:06 2011 +0000
+++ b/gui/util/bitmap.h	Mon Apr 04 19:12:31 2011 +0000
@@ -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 @@
 
 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 */