2012-06-24 18:42:10 -04:00
|
|
|
//
|
|
|
|
// SuperTuxKart - a fun racing game with go-kart
|
2015-03-29 20:31:42 -04:00
|
|
|
// Copyright (C) 2012-2015 Marianne Gagnon
|
2012-06-24 18:42:10 -04:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 3
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
2012-06-24 11:38:17 -04:00
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
2012-06-24 13:14:34 -04:00
|
|
|
#include "guiengine/engine.hpp"
|
|
|
|
#include "guiengine/scalable_font.hpp"
|
2014-10-18 12:16:50 -04:00
|
|
|
#include "graphics/2dutils.hpp"
|
2015-08-12 16:54:42 -04:00
|
|
|
#include "graphics/irr_driver.hpp"
|
2012-06-24 11:38:17 -04:00
|
|
|
#include "states_screens/cutscene_gui.hpp"
|
|
|
|
|
2012-06-24 13:14:34 -04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2012-06-24 11:38:17 -04:00
|
|
|
CutsceneGUI::CutsceneGUI()
|
|
|
|
{
|
|
|
|
m_fade_level = 0.0f;
|
|
|
|
}
|
2012-06-24 13:14:34 -04:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
2012-06-24 18:42:10 -04:00
|
|
|
|
2012-06-24 11:38:17 -04:00
|
|
|
CutsceneGUI::~CutsceneGUI()
|
|
|
|
{
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2012-06-24 18:42:10 -04:00
|
|
|
}
|
2012-06-24 13:14:34 -04:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
2012-06-24 18:42:10 -04:00
|
|
|
|
2012-06-24 11:38:17 -04:00
|
|
|
void CutsceneGUI::renderGlobal(float dt)
|
|
|
|
{
|
2016-04-17 10:29:59 -04:00
|
|
|
#ifndef SERVER_ONLY
|
2015-08-12 16:54:42 -04:00
|
|
|
core::dimension2d<u32> screen_size = irr_driver->getActualScreenSize();
|
|
|
|
|
2012-06-24 11:38:17 -04:00
|
|
|
if (m_fade_level > 0.0f)
|
|
|
|
{
|
2014-01-21 17:01:58 -05:00
|
|
|
GL32_draw2DRectangle(
|
2012-07-01 17:13:58 -04:00
|
|
|
video::SColor((int)(m_fade_level*255), 0,0,0),
|
|
|
|
core::rect<s32>(0, 0,
|
2015-08-12 16:54:42 -04:00
|
|
|
screen_size.Width,
|
|
|
|
screen_size.Height));
|
2012-06-24 11:38:17 -04:00
|
|
|
}
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2012-06-24 13:14:34 -04:00
|
|
|
if (m_subtitle.size() > 0)
|
|
|
|
{
|
2015-08-12 16:54:42 -04:00
|
|
|
core::rect<s32> r(0, screen_size.Height - GUIEngine::getFontHeight()*2,
|
|
|
|
screen_size.Width, screen_size.Height);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2015-08-12 16:54:42 -04:00
|
|
|
if (GUIEngine::getFont()->getDimension(m_subtitle.c_str()).Width > screen_size.Width)
|
2012-11-10 18:52:30 -05:00
|
|
|
{
|
|
|
|
GUIEngine::getSmallFont()->draw(m_subtitle, r,
|
2013-05-29 18:04:35 -04:00
|
|
|
video::SColor(255,255,255,255), true, true, NULL);
|
2012-11-10 18:52:30 -05:00
|
|
|
}
|
|
|
|
else
|
2013-05-29 18:04:35 -04:00
|
|
|
{
|
2012-11-10 18:52:30 -05:00
|
|
|
GUIEngine::getFont()->draw(m_subtitle, r,
|
|
|
|
video::SColor(255,255,255,255), true, true, NULL);
|
|
|
|
}
|
2012-06-24 13:14:34 -04:00
|
|
|
}
|
2016-04-17 10:29:59 -04:00
|
|
|
#endif
|
2012-06-24 18:42:10 -04:00
|
|
|
}
|
2012-06-24 11:38:17 -04:00
|
|
|
|