From ff5680d01098ba9e1ac888fc776fb0e0298217be Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 10 May 2001 15:39:02 +0000 Subject: [PATCH] Fixed displaying of images with alpha (broken by the previous commit). The fix still doesn't look right (hermes seems to do weird things internally, and there is no documentation for it) People with big endian machines please test if it works for you (install hermes lib first). Then try to start wmaker in different screen depths (15, 16, 24, 32) and check if there are depths that do not work (either crash, or display other colors than you expect). Little endian machines seem ok. --- wrlib/convert.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/wrlib/convert.c b/wrlib/convert.c index 970b3d3f..65533208 100644 --- a/wrlib/convert.c +++ b/wrlib/convert.c @@ -801,19 +801,14 @@ hermesConvert(RContext *context, RImage *image) return NULL; } - if (HAS_ALPHA(image)) { - source.r = 0xff000000; - source.g = 0x00ff0000; - source.b = 0x0000ff00; - source.a = 0x000000ff; - source.bits = 32; - } else { - source.r = 0xff0000; - source.g = 0x00ff00; - source.b = 0x0000ff; - source.a = 0x000000; - source.bits = 24; - } + /* The masks look weird for images with alpha. but they work this way + * wth does hermes do internally? + */ + source.r = 0xff0000; + source.g = 0x00ff00; + source.b = 0x0000ff; + source.a = 0x000000; + source.bits = (HAS_ALPHA(image) ? 32 : 24); source.indexed = 0; source.has_colorkey = 0;