mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-13 21:02:34 +08:00
Undid some assumptions on how visible works as they were not entirely right
Effect's visible behaves a little weirdly :/ need to properly understand it Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
parent
92bdde2bd1
commit
e1fe215398
@ -125,14 +125,8 @@ CObject* CObject::fromJSON (json data, CScene* scene, const CContainer* containe
|
||||
|
||||
for (; cur != end; cur ++)
|
||||
{
|
||||
auto effectVisible_it = data.find ("visible");
|
||||
CUserSettingBoolean* effectVisible;
|
||||
|
||||
if (effectVisible_it == data.end ())
|
||||
effectVisible = CUserSettingBoolean::fromScalar (true);
|
||||
else
|
||||
effectVisible = CUserSettingBoolean::fromJSON (*effectVisible_it);
|
||||
|
||||
auto effectVisible = jsonFindUserConfig <CUserSettingBoolean, bool> (data, "visible", true);
|
||||
|
||||
object->insertEffect (
|
||||
Objects::CEffect::fromJSON (*cur, effectVisible, object, container)
|
||||
);
|
||||
|
@ -335,11 +335,6 @@ void CImage::setupPasses ()
|
||||
for (; cur != end; cur ++)
|
||||
{
|
||||
Effects::CPass* pass = *cur;
|
||||
|
||||
// do not do anything if the passes' effect is not visible
|
||||
if (pass->getMaterial ()->getEffect ()->isVisible () == false)
|
||||
continue;
|
||||
|
||||
const CFBO* prevDrawTo = drawTo;
|
||||
GLuint spacePosition = (first) ? this->getCopySpacePosition () : this->getPassSpacePosition ();
|
||||
glm::mat4* projection = (first) ? &this->m_modelViewProjectionCopy : &this->m_modelViewProjectionPass;
|
||||
@ -359,29 +354,11 @@ void CImage::setupPasses ()
|
||||
drawTo = this->getScene ()->findFBO (target);
|
||||
}
|
||||
// determine if it's the last element in the list as this is a screen-copy-like process
|
||||
else
|
||||
else if (std::next (cur) == end && this->getImage ()->isVisible () == true)
|
||||
{
|
||||
bool isLastPass = std::next (cur) == end && this->getImage ()->isVisible () == true;
|
||||
auto lastIt = std::next (cur);
|
||||
|
||||
// determine if this is the real last pass
|
||||
for (; lastIt != end && isLastPass == false; lastIt ++)
|
||||
{
|
||||
Effects::CPass* lastPass = *lastIt;
|
||||
|
||||
if (lastPass->getMaterial ()->getEffect ()->isVisible () == true)
|
||||
{
|
||||
isLastPass = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isLastPass == true)
|
||||
{
|
||||
spacePosition = this->getSceneSpacePosition ();
|
||||
drawTo = this->getScene ()->getFBO ();
|
||||
projection = &this->m_modelViewProjectionScreen;
|
||||
}
|
||||
spacePosition = this->getSceneSpacePosition ();
|
||||
drawTo = this->getScene ()->getFBO ();
|
||||
projection = &this->m_modelViewProjectionScreen;
|
||||
}
|
||||
|
||||
pass->setDestination (drawTo);
|
||||
@ -446,25 +423,7 @@ void CImage::render ()
|
||||
|
||||
for (; cur != end; cur ++)
|
||||
{
|
||||
if ((*cur)->getMaterial ()->getEffect ()->isVisible () == false)
|
||||
continue;
|
||||
|
||||
bool isLastPass = std::next (cur) == end && this->getImage ()->isVisible () == true;
|
||||
auto lastIt = std::next (cur);
|
||||
|
||||
// determine if this is the real last pass
|
||||
for (; lastIt != end && isLastPass == false; lastIt ++)
|
||||
{
|
||||
Effects::CPass* lastPass = *lastIt;
|
||||
|
||||
if (lastPass->getMaterial ()->getEffect ()->isVisible () == true)
|
||||
{
|
||||
isLastPass = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isLastPass == true)
|
||||
if (std::next (cur) == end)
|
||||
glColorMask (true, true, true, false);
|
||||
|
||||
(*cur)->render ();
|
||||
|
Loading…
Reference in New Issue
Block a user