summaryrefslogtreecommitdiffstats
path: root/xbmc/windows/GUIWindowSplash.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
commitc04dcc2e7d834218ef2d4194331e383402495ae1 (patch)
tree7333e38d10d75386e60f336b80c2443c1166031d /xbmc/windows/GUIWindowSplash.cpp
parentInitial commit. (diff)
downloadkodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz
kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/windows/GUIWindowSplash.cpp')
-rw-r--r--xbmc/windows/GUIWindowSplash.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/xbmc/windows/GUIWindowSplash.cpp b/xbmc/windows/GUIWindowSplash.cpp
new file mode 100644
index 0000000..dadd61e
--- /dev/null
+++ b/xbmc/windows/GUIWindowSplash.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2015-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#include "GUIWindowSplash.h"
+
+#include "Util.h"
+#include "guilib/GUIImage.h"
+#include "guilib/GUIWindowManager.h"
+#include "settings/AdvancedSettings.h"
+#include "settings/SettingsComponent.h"
+
+CGUIWindowSplash::CGUIWindowSplash(void) : CGUIWindow(WINDOW_SPLASH, ""), m_image(nullptr)
+{
+ m_loadType = LOAD_ON_GUI_INIT;
+}
+
+CGUIWindowSplash::~CGUIWindowSplash(void) = default;
+
+void CGUIWindowSplash::OnInitWindow()
+{
+ if (!CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_splashImage)
+ return;
+
+ m_image = std::unique_ptr<CGUIImage>(new CGUIImage(0, 0, 0, 0, CServiceBroker::GetWinSystem()->GetGfxContext().GetWidth(), CServiceBroker::GetWinSystem()->GetGfxContext().GetHeight(), CTextureInfo(CUtil::GetSplashPath())));
+ m_image->SetAspectRatio(CAspectRatio::AR_SCALE);
+}
+
+void CGUIWindowSplash::Render()
+{
+ CServiceBroker::GetWinSystem()->GetGfxContext().SetRenderingResolution(CServiceBroker::GetWinSystem()->GetGfxContext().GetResInfo(), true);
+
+ if (!m_image)
+ return;
+
+ m_image->SetWidth(CServiceBroker::GetWinSystem()->GetGfxContext().GetWidth());
+ m_image->SetHeight(CServiceBroker::GetWinSystem()->GetGfxContext().GetHeight());
+ m_image->AllocResources();
+ m_image->Render();
+ m_image->FreeResources();
+}