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

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
Alexis Maiquez 2022-10-28 05:06:21 +02:00
parent 4e3254e843
commit 70d815c183
2 changed files with 9 additions and 1 deletions

View File

@ -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);

View File

@ -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
};
}