screensaver: fix decoding of transparency in xpm files
Use 0 as transparent pixel. This is needed when using premultiplied alpha.
This commit is contained in:
committed by
Kristian Høgsberg
parent
38b4d62ece
commit
774c34a381
@@ -80,15 +80,15 @@ read_xpm_color(uint32_t *ctable, const char *line)
|
|||||||
value = strtol(&cstr[1], &end, 16);
|
value = strtol(&cstr[1], &end, 16);
|
||||||
|
|
||||||
if (strcmp(cstr, "None") == 0)
|
if (strcmp(cstr, "None") == 0)
|
||||||
ctable[key] = 0x00ffffff;
|
ctable[key] = 0x00000000;
|
||||||
else if (cstr[0] != '#' || !(cstr[1] != '\0' && *end == '\0')) {
|
else if (cstr[0] != '#' || !(cstr[1] != '\0' && *end == '\0')) {
|
||||||
fprintf(stderr, "%s: error interpreting XPM color '%s'\n",
|
fprintf(stderr, "%s: error interpreting XPM color '%s'\n",
|
||||||
progname, cstr);
|
progname, cstr);
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
ctable[key] = value | 0xff000000;
|
ctable[key] = value | 0xff000000;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
read_xpm_row(char *data, const char *line, uint32_t *ctable, int width)
|
read_xpm_row(char *data, const char *line, uint32_t *ctable, int width)
|
||||||
|
|||||||
Reference in New Issue
Block a user