mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-14 05:12:25 +08:00
~ fixed video background playback being broken
~ CTexture should properly pick up the right width and height for animated backgrounds too Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
parent
64d2f77d41
commit
34635ba6ac
8
main.cpp
8
main.cpp
@ -227,14 +227,18 @@ int main (int argc, char* argv[])
|
||||
return 3;
|
||||
}
|
||||
|
||||
// parse the project.json file
|
||||
auto project = WallpaperEngine::Core::CProject::fromFile ("project.json", containers);
|
||||
// go to the right folder so the videos will play
|
||||
if (project->getWallpaper ()->is <WallpaperEngine::Core::CVideo> () == true)
|
||||
chdir (path.c_str ());
|
||||
|
||||
// initialize custom context class
|
||||
WallpaperEngine::Render::CContext* context = new WallpaperEngine::Render::CContext (screens, window);
|
||||
// initialize mouse support
|
||||
context->setMouse (new CMouseInput (window));
|
||||
// set the default viewport
|
||||
context->setDefaultViewport ({0, 0, windowWidth, windowHeight});
|
||||
// parse the project.json file
|
||||
auto project = WallpaperEngine::Core::CProject::fromFile ("project.json", containers);
|
||||
// ensure the context knows what wallpaper to render
|
||||
context->setWallpaper (
|
||||
WallpaperEngine::Render::CWallpaper::fromWallpaper (project->getWallpaper (), containers, context)
|
||||
|
@ -24,8 +24,8 @@ CTexture::CTexture (void* fileData)
|
||||
{
|
||||
// set the texture resolution
|
||||
this->m_resolution = {
|
||||
this->m_header->textureWidth, this->m_header->textureHeight,
|
||||
this->m_header->width, this->m_header->height
|
||||
this->m_header->textureWidth, this->m_header->textureHeight,
|
||||
this->m_header->width, this->m_header->height
|
||||
};
|
||||
}
|
||||
|
||||
@ -212,12 +212,12 @@ const uint32_t CTexture::getTextureHeight () const
|
||||
|
||||
const uint32_t CTexture::getRealWidth () const
|
||||
{
|
||||
return this->getHeader ()->width;
|
||||
return this->isAnimated () == true ? this->getHeader ()->gifWidth : this->getHeader ()->width;
|
||||
}
|
||||
|
||||
const uint32_t CTexture::getRealHeight () const
|
||||
{
|
||||
return this->getHeader ()->height;
|
||||
return this->isAnimated () == true ? this->getHeader ()->gifHeight : this->getHeader ()->height;
|
||||
}
|
||||
|
||||
const ITexture::TextureFormat CTexture::getFormat () const
|
||||
|
Loading…
Reference in New Issue
Block a user