Эх сурвалжийг харах

fix: black backgrounds on latest wallpaperengine version (g_Color4 was added)

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
Alexis Maiquez 2 жил өмнө
parent
commit
170af5ff7c

+ 8 - 0
src/WallpaperEngine/Render/CWallpaper.cpp

@@ -239,6 +239,8 @@ void CWallpaper::setupFramebuffers () {
     // create framebuffer for the scene
     this->m_sceneFBO = this->createFBO ("_rt_FullFrameBuffer", ITexture::TextureFormat::ARGB8888, clamp, 1.0, width,
                                         height, width, height);
+
+    this->aliasFBO ("_rt_MipMappedFrameBuffer", this->m_sceneFBO);
 }
 
 CAudioContext& CWallpaper::getAudioContext () {
@@ -255,6 +257,12 @@ CFBO* CWallpaper::createFBO (const std::string& name, ITexture::TextureFormat fo
     return fbo;
 }
 
+void CWallpaper::aliasFBO(const std::string& alias, CFBO* original)
+{
+    this->m_fbos.insert (std::make_pair (alias, original));
+}
+
+
 const std::map<std::string, CFBO*>& CWallpaper::getFBOs () const {
     return this->m_fbos;
 }

+ 7 - 0
src/WallpaperEngine/Render/CWallpaper.h

@@ -81,6 +81,13 @@ class CWallpaper : public Helpers::CContextAware {
     CFBO* createFBO (const std::string& name, ITexture::TextureFormat format, ITexture::TextureFlags flags, float scale,
                      uint32_t realWidth, uint32_t realHeight, uint32_t textureWidth, uint32_t textureHeight);
 
+    /**
+     * Creates an alias of an existing fbo
+     * @param alias
+     * @param original
+     */
+    void aliasFBO (const std::string& alias, CFBO* original);
+
     /**
      * @return The full FBO list to work with
      */

+ 1 - 0
src/WallpaperEngine/Render/Objects/Effects/CPass.cpp

@@ -519,6 +519,7 @@ void CPass::setupUniforms () {
     this->addUniform ("g_UserAlpha", this->m_material->getImage ()->getImage ()->getAlpha ());
     this->addUniform ("g_Alpha", this->m_material->getImage ()->getImage ()->getAlpha ());
     this->addUniform ("g_Color", this->m_material->getImage ()->getImage ()->getColor ());
+    this->addUniform ("g_Color4", glm::vec4(this->m_material->getImage ()->getImage ()->getColor (), 1));
     // TODO: VALIDATE THAT G_COMPOSITECOLOR REALLY COMES FROM THIS ONE
     this->addUniform ("g_CompositeColor", this->m_material->getImage ()->getImage ()->getColor ());
     // add some external variables