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,7 +39,12 @@ CImage::CImage (CScene* scene, Core::Objects::CImage* image) :
|
||||
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 (textures.empty() == false)
|
||||
{
|
||||
std::string textureName = *textures.begin ();
|
||||
|
||||
if (textureName.find ("_rt_") == 0)
|
||||
{
|
||||
@ -50,6 +55,14 @@ CImage::CImage (CScene* scene, Core::Objects::CImage* image) :
|
||||
// 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
|
||||
{
|
||||
glm::vec2 realSize = size * glm::vec2 (scale);
|
||||
|
||||
// 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
|
||||
std::ostringstream nameA, nameB;
|
||||
|
@ -106,6 +106,12 @@ namespace WallpaperEngine::Render::Shaders
|
||||
|
||||
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 end = sTypes.end ();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user