[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / windows / GUIWindowSplash.cpp
blob19ba18981174c785d2c3b2d9e7bc04e683f0c979
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 #include <memory>
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)
29 return;
31 m_image = std::make_unique<CGUIImage>(
32 0, 0, .0f, .0f,
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);
43 if (!m_image)
44 return;
46 m_image->SetWidth(CServiceBroker::GetWinSystem()->GetGfxContext().GetWidth());
47 m_image->SetHeight(CServiceBroker::GetWinSystem()->GetGfxContext().GetHeight());
48 m_image->AllocResources();
49 m_image->Render();
50 m_image->FreeResources();