mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 13:56:48 +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,13 +125,7 @@ CObject* CObject::fromJSON (json data, CScene* scene, const CContainer* containe
|
|||||||
|
|
||||||
for (; cur != end; cur ++)
|
for (; cur != end; cur ++)
|
||||||
{
|
{
|
||||||
auto effectVisible_it = data.find ("visible");
|
auto effectVisible = jsonFindUserConfig <CUserSettingBoolean, bool> (data, "visible", true);
|
||||||
CUserSettingBoolean* effectVisible;
|
|
||||||
|
|
||||||
if (effectVisible_it == data.end ())
|
|
||||||
effectVisible = CUserSettingBoolean::fromScalar (true);
|
|
||||||
else
|
|
||||||
effectVisible = CUserSettingBoolean::fromJSON (*effectVisible_it);
|
|
||||||
|
|
||||||
object->insertEffect (
|
object->insertEffect (
|
||||||
Objects::CEffect::fromJSON (*cur, effectVisible, object, container)
|
Objects::CEffect::fromJSON (*cur, effectVisible, object, container)
|
||||||
|
@ -335,11 +335,6 @@ void CImage::setupPasses ()
|
|||||||
for (; cur != end; cur ++)
|
for (; cur != end; cur ++)
|
||||||
{
|
{
|
||||||
Effects::CPass* pass = *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;
|
const CFBO* prevDrawTo = drawTo;
|
||||||
GLuint spacePosition = (first) ? this->getCopySpacePosition () : this->getPassSpacePosition ();
|
GLuint spacePosition = (first) ? this->getCopySpacePosition () : this->getPassSpacePosition ();
|
||||||
glm::mat4* projection = (first) ? &this->m_modelViewProjectionCopy : &this->m_modelViewProjectionPass;
|
glm::mat4* projection = (first) ? &this->m_modelViewProjectionCopy : &this->m_modelViewProjectionPass;
|
||||||
@ -359,30 +354,12 @@ void CImage::setupPasses ()
|
|||||||
drawTo = this->getScene ()->findFBO (target);
|
drawTo = this->getScene ()->findFBO (target);
|
||||||
}
|
}
|
||||||
// determine if it's the last element in the list as this is a screen-copy-like process
|
// 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 ();
|
spacePosition = this->getSceneSpacePosition ();
|
||||||
drawTo = this->getScene ()->getFBO ();
|
drawTo = this->getScene ()->getFBO ();
|
||||||
projection = &this->m_modelViewProjectionScreen;
|
projection = &this->m_modelViewProjectionScreen;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
pass->setDestination (drawTo);
|
pass->setDestination (drawTo);
|
||||||
pass->setInput (asInput);
|
pass->setInput (asInput);
|
||||||
@ -446,25 +423,7 @@ void CImage::render ()
|
|||||||
|
|
||||||
for (; cur != end; cur ++)
|
for (; cur != end; cur ++)
|
||||||
{
|
{
|
||||||
if ((*cur)->getMaterial ()->getEffect ()->isVisible () == false)
|
if (std::next (cur) == end)
|
||||||
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)
|
|
||||||
glColorMask (true, true, true, false);
|
glColorMask (true, true, true, false);
|
||||||
|
|
||||||
(*cur)->render ();
|
(*cur)->render ();
|
||||||
|
Loading…
Reference in New Issue
Block a user