2 * Copyright (C) 2015-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
9 #include "GUIWindowSplash.h"
12 #include "guilib/GUIImage.h"
13 #include "guilib/GUIWindowManager.h"
14 #include "settings/AdvancedSettings.h"
15 #include "settings/SettingsComponent.h"
17 CGUIWindowSplash::CGUIWindowSplash(void) : CGUIWindow(WINDOW_SPLASH
, ""), m_image(nullptr)
19 m_loadType
= LOAD_ON_GUI_INIT
;
22 CGUIWindowSplash::~CGUIWindowSplash(void) = default;
24 void CGUIWindowSplash::OnInitWindow()
26 if (!CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_splashImage
)
29 m_image
= std::unique_ptr
<CGUIImage
>(new CGUIImage(0, 0, 0, 0, CServiceBroker::GetWinSystem()->GetGfxContext().GetWidth(), CServiceBroker::GetWinSystem()->GetGfxContext().GetHeight(), CTextureInfo(CUtil::GetSplashPath())));
30 m_image
->SetAspectRatio(CAspectRatio::AR_SCALE
);
33 void CGUIWindowSplash::Render()
35 CServiceBroker::GetWinSystem()->GetGfxContext().SetRenderingResolution(CServiceBroker::GetWinSystem()->GetGfxContext().GetResInfo(), true);
40 m_image
->SetWidth(CServiceBroker::GetWinSystem()->GetGfxContext().GetWidth());
41 m_image
->SetHeight(CServiceBroker::GetWinSystem()->GetGfxContext().GetHeight());
42 m_image
->AllocResources();
44 m_image
->FreeResources();