# HG changeset patch # User ib # Date 1301944351 0 # Node ID 5f3171d4d7a41a7919f673826b5f8a7d12c1ef7a # Parent 64d19aaf624afe704cebbc0ebd584b3517169a04 Define the transparent color as a macro. Additionally, remove it as parameter from Convert32to1(), because there is only this single one. diff -r 64d19aaf624a -r 5f3171d4d7a4 gui/mplayer/gui_common.c --- 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; } diff -r 64d19aaf624a -r 5f3171d4d7a4 gui/mplayer/menu.c --- 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; diff -r 64d19aaf624a -r 5f3171d4d7a4 gui/skin/font.c --- 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) { diff -r 64d19aaf624a -r 5f3171d4d7a4 gui/skin/skin.c --- 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; } diff -r 64d19aaf624a -r 5f3171d4d7a4 gui/util/bitmap.c --- 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; diff -r 64d19aaf624a -r 5f3171d4d7a4 gui/util/bitmap.h --- 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 +#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 */