mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 13:56:48 +08:00
+ Added handling for floating point precision qualifiers on type detection
+ Fixed textures not being detected properly on images that do not have any source Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
parent
13bcd52e8c
commit
342522cd1d
@ -39,16 +39,29 @@ CImage::CImage (CScene* scene, Core::Objects::CImage* image) :
|
|||||||
throw std::runtime_error ("Only centered images are supported for now!");
|
throw std::runtime_error ("Only centered images are supported for now!");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string textureName = (*(*this->m_image->getMaterial ()->getPasses ().begin ())->getTextures ().begin ());
|
// detect texture (if any)
|
||||||
|
auto textures = (*this->m_image->getMaterial ()->getPasses ().begin ())->getTextures ();
|
||||||
|
|
||||||
if (textureName.find ("_rt_") == 0)
|
if (textures.empty() == false)
|
||||||
{
|
{
|
||||||
this->m_texture = this->getScene ()->findFBO (textureName);
|
std::string textureName = *textures.begin ();
|
||||||
|
|
||||||
|
if (textureName.find ("_rt_") == 0)
|
||||||
|
{
|
||||||
|
this->m_texture = this->getScene ()->findFBO (textureName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// get the first texture on the first pass (this one represents the image assigned to this object)
|
||||||
|
this->m_texture = this->getScene ()->getContainer ()->readTexture (textureName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// get the first texture on the first pass (this one represents the image assigned to this object)
|
glm::vec2 realSize = size * glm::vec2 (scale);
|
||||||
this->m_texture = this->getScene ()->getContainer ()->readTexture (textureName);
|
|
||||||
|
// TODO: create a dummy texture of correct size, fbo constructors should be enough, but this should be properly handled
|
||||||
|
this->m_texture = new CFBO ("", ITexture::TextureFormat::ARGB8888, 1, realSize.x, realSize.y, realSize.x, realSize.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// register both FBOs into the scene
|
// register both FBOs into the scene
|
||||||
|
@ -106,6 +106,12 @@ namespace WallpaperEngine::Render::Shaders
|
|||||||
|
|
||||||
std::string Compiler::extractType (std::string::const_iterator& it)
|
std::string Compiler::extractType (std::string::const_iterator& it)
|
||||||
{
|
{
|
||||||
|
// first of all check for highp/mediump/lowp as these operators have to be ignored
|
||||||
|
this->peekString ("highp", it);
|
||||||
|
this->peekString ("mediump", it);
|
||||||
|
this->peekString ("lowp", it);
|
||||||
|
this->ignoreSpaces (it);
|
||||||
|
|
||||||
auto cur = sTypes.begin ();
|
auto cur = sTypes.begin ();
|
||||||
auto end = sTypes.end ();
|
auto end = sTypes.end ();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user