mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-07 22:34:18 +01:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user