Browse Source

~ Fixed regression in composite layer handling
~ Properly fixed usage of "previous" as texture

Signed-off-by: Alexis Maiquez <almamu@almamu.com>

Alexis Maiquez 4 năm trước cách đây
mục cha
commit
13bcd52e8c

+ 2 - 2
src/WallpaperEngine/Render/Objects/CImage.cpp

@@ -57,8 +57,8 @@ CImage::CImage (CScene* scene, Core::Objects::CImage* image) :
     nameA << "_rt_imageLayerComposite_" << this->getImage ()->getId () << "_a";
     nameB << "_rt_imageLayerComposite_" << this->getImage ()->getId () << "_b";
 
-    this->m_currentMainFBO = this->m_mainFBO = scene->createFBO (nameB.str (), ITexture::TextureFormat::ARGB8888, 1, this->m_texture->getRealWidth (), this->m_texture->getRealHeight (), this->m_texture->getRealWidth (), this->m_texture->getRealHeight ());
-    this->m_currentSubFBO = this->m_subFBO = scene->createFBO (nameA.str (), ITexture::TextureFormat::ARGB8888, 1, this->m_texture->getRealWidth (), this->m_texture->getRealHeight (), this->m_texture->getRealWidth (), this->m_texture->getRealHeight ());
+    this->m_currentMainFBO = this->m_mainFBO = scene->createFBO (nameA.str (), ITexture::TextureFormat::ARGB8888, 1, this->m_texture->getRealWidth (), this->m_texture->getRealHeight (), this->m_texture->getRealWidth (), this->m_texture->getRealHeight ());
+    this->m_currentSubFBO = this->m_subFBO = scene->createFBO (nameB.str (), ITexture::TextureFormat::ARGB8888, 1, this->m_texture->getRealWidth (), this->m_texture->getRealHeight (), this->m_texture->getRealWidth (), this->m_texture->getRealHeight ());
 
     GLfloat realWidth = this->m_texture->getRealWidth () / 2;
     GLfloat realHeight = this->m_texture->getRealHeight () / 2;

+ 4 - 4
src/WallpaperEngine/Render/Objects/Effects/CPass.cpp

@@ -40,7 +40,7 @@ ITexture* CPass::resolveTexture (ITexture* expected, int index, ITexture* previo
         if (it == this->m_fbos.end ())
             return nullptr;
 
-        return (*it).second;
+        expected = (*it).second;
     }
 
     // first check in the binds and replace it if necessary
@@ -417,7 +417,7 @@ void CPass::setupUniforms ()
 
             namestream << "g_Texture" << index << "Resolution";
 
-            texture = this->resolveTexture ((*cur), index);
+            texture = this->resolveTexture ((*cur), index, texture);
             this->addUniform (namestream.str (), texture->getResolution ());
             lastTextureIndex ++;
         }
@@ -437,7 +437,7 @@ void CPass::setupUniforms ()
 
             namestream << "g_Texture" << (*cur).first << "Resolution";
 
-            texture = this->resolveTexture ((*cur).second, (*cur).first);
+            texture = this->resolveTexture ((*cur).second, (*cur).first, texture);
             this->addUniform (namestream.str (), texture->getResolution ());
         }
     }
@@ -456,7 +456,7 @@ void CPass::setupUniforms ()
 
             namestream << "g_Texture" << (*cur).first << "Resolution";
 
-            texture = this->resolveTexture ((*cur).second, (*cur).first);
+            texture = this->resolveTexture ((*cur).second, (*cur).first, texture);
             this->addUniform (namestream.str (), texture->getResolution ());
         }
     }