Skip to content

Commit

Permalink
fix: support shaders without textures (like flat), improves #184
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Maiquez <[email protected]>
  • Loading branch information
Almamu committed Dec 14, 2023
1 parent 170af5f commit eab6a07
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/WallpaperEngine/Core/Objects/CEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,17 @@ CEffect* CEffect::fromJSON (json data, CUserSettingBoolean* visible, CObject* ob
if (textureNumber == 0) {
auto* image = object->as<CImage> ();

texture = (*(*image->getMaterial ()->getPasses ().begin ())->getTextures ().begin ());
auto passTextures = (*image->getMaterial()->getPasses ().begin ())->getTextures ();

if (passTextures.empty())
{
// TODO: SET CHECKERBOARD TEXTURE AS DEFAULT IN THESE SITUATIONS
texture = "";
}
else
{
texture = *passTextures.begin();
}
} else {
texture = "";
}
Expand Down

0 comments on commit eab6a07

Please sign in to comment.