mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 14:08:06 +01:00
WPrefs: changed renderTexture to always fallback to solid black when image can't be loaded
As raised by Carlos R. Mafra and Doug Torrance, when an image is used in a texture but the image cannot be loaded, there are some case where WPrefs misbehaves. This patch display a warning in every case where the image could not be loaded, and always switch to black texture as a fallback, which was not the case previously. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
1a01ac103f
commit
8c6525a2b7
@@ -512,13 +512,17 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int
|
|||||||
path = wfindfileinarray(GetObjectForKey("PixmapPath"), str);
|
path = wfindfileinarray(GetObjectForKey("PixmapPath"), str);
|
||||||
if (path) {
|
if (path) {
|
||||||
timage = RLoadImage(rc, path, 0);
|
timage = RLoadImage(rc, path, 0);
|
||||||
|
if (!timage)
|
||||||
|
wwarning("could not load file '%s': %s", path, RMessageForError(RErrorCode));
|
||||||
|
wfree(path);
|
||||||
|
} else {
|
||||||
|
wwarning("could not find file '%s' for %s of texture", str, type);
|
||||||
|
timage = NULL;
|
||||||
|
}
|
||||||
if (!timage) {
|
if (!timage) {
|
||||||
wwarning("could not load file '%s': %s", path ? path : str, RMessageForError(RErrorCode));
|
|
||||||
texture = WMCreatePropListFromDescription("(solid, black)");
|
texture = WMCreatePropListFromDescription("(solid, black)");
|
||||||
type = "solid";
|
type = "solid";
|
||||||
}
|
}
|
||||||
wfree(path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcasecmp(type, "solid") == 0) {
|
if (strcasecmp(type, "solid") == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user