[filesystem][SpecialProtocol] Removed assert from GetPath
[xbmc.git] / xbmc / windows / GUIWindowSplash.cpp
blobdadd61eab9808e17ee376f6228b9e46790670783
1 /*
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.
7 */
9 #include "GUIWindowSplash.h"
11 #include "Util.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)
27 return;
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);
37 if (!m_image)
38 return;
40 m_image->SetWidth(CServiceBroker::GetWinSystem()->GetGfxContext().GetWidth());
41 m_image->SetHeight(CServiceBroker::GetWinSystem()->GetGfxContext().GetHeight());
42 m_image->AllocResources();
43 m_image->Render();
44 m_image->FreeResources();