Sfoglia il codice sorgente

Properly detect texture sizes so effects using smaller mask textures are properly applied

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
Alexis Maiquez 3 anni fa
parent
commit
70d815c183
2 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 4 0
      main.cpp
  2. 5 1
      src/WallpaperEngine/Assets/CTexture.cpp

+ 4 - 0
main.cpp

@@ -386,6 +386,10 @@ int main (int argc, char* argv[])
         WallpaperEngine::Render::CWallpaper::fromWallpaper (project->getWallpaper (), containers, context)
     );
 
+    // update maximum FPS if it's a video
+    if (context->getWallpaper ()->is <WallpaperEngine::Render::CVideo> () == true)
+        maximumFPS = context->getWallpaper ()->as <WallpaperEngine::Render::CVideo> ()->getFPS ();
+
     // TODO: FIGURE OUT THE REQUIRED INPUT MODE, AS SOME WALLPAPERS USE THINGS LIKE MOUSE POSITION
     // glfwSetInputMode (window, GLFW_STICKY_KEYS, GL_TRUE);
 

+ 5 - 1
src/WallpaperEngine/Assets/CTexture.cpp

@@ -22,9 +22,13 @@ CTexture::CTexture (void* fileData)
     }
     else
     {
+        // TODO: DETERMINE IF TEXTURES CAN HAVE 0 IMAGES
+        // get first image size
+        std::vector<TextureMipmap*>::const_iterator element = this->m_header->images.find (0)->second.begin ();
+
         // set the texture resolution
         this->m_resolution = {
-            this->m_header->textureWidth, this->m_header->textureHeight,
+            (*element)->width, (*element)->height,
             this->m_header->width, this->m_header->height
         };
     }