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"
19 CGUIWindowSplash::CGUIWindowSplash(void) : CGUIWindow(WINDOW_SPLASH
, ""), m_image(nullptr)
21 m_loadType
= LOAD_ON_GUI_INIT
;
24 CGUIWindowSplash::~CGUIWindowSplash(void) = default;
26 void CGUIWindowSplash::OnInitWindow()
28 if (!CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_splashImage
)
31 m_image
= std::make_unique
<CGUIImage
>(
33 static_cast<float>(CServiceBroker::GetWinSystem()->GetGfxContext().GetWidth()),
34 static_cast<float>(CServiceBroker::GetWinSystem()->GetGfxContext().GetHeight()),
35 CTextureInfo(CUtil::GetSplashPath()));
36 m_image
->SetAspectRatio(CAspectRatio::AR_SCALE
);
39 void CGUIWindowSplash::Render()
41 CServiceBroker::GetWinSystem()->GetGfxContext().SetRenderingResolution(CServiceBroker::GetWinSystem()->GetGfxContext().GetResInfo(), true);
46 m_image
->SetWidth(CServiceBroker::GetWinSystem()->GetGfxContext().GetWidth());
47 m_image
->SetHeight(CServiceBroker::GetWinSystem()->GetGfxContext().GetHeight());
48 m_image
->AllocResources();
50 m_image
->FreeResources();