Files
itgmania212121/stepmania/src/FadingBanner.cpp
T

55 lines
1.3 KiB
C++
Raw Normal View History

#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: FadingBanner
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
2003-01-02 02:59:35 +00:00
Glenn Maynard
-----------------------------------------------------------------------------
*/
#include "FadingBanner.h"
void FadingBanner::SetCroppedSize( float fWidth, float fHeight )
{
2003-01-02 02:59:35 +00:00
m_BackBanner.SetCroppedSize( fWidth, fHeight );
Banner::SetCroppedSize( fWidth, fHeight );
}
void FadingBanner::Update( float fDeltaTime )
{
2003-01-02 02:59:35 +00:00
m_BackBanner.Update(fDeltaTime);
Banner::Update( fDeltaTime );
}
2003-01-02 02:59:35 +00:00
void FadingBanner::DrawPrimitives()
{
2003-01-02 02:59:35 +00:00
Banner::DrawPrimitives();
m_BackBanner.Draw();
}
2003-01-02 02:59:35 +00:00
bool FadingBanner::Load( RageTextureID ID )
{
BeforeChange();
2003-01-02 02:59:35 +00:00
return Banner::Load(ID);
}
2003-01-02 02:59:35 +00:00
void FadingBanner::BeforeChange()
{
2003-01-02 02:59:35 +00:00
// move the back banner to the front in preparation for a cross fade
if( this->GetTexturePath() != "" )
{
m_BackBanner.Load( this->GetTexturePath() );
m_BackBanner.SetScrolling( this->IsScrolling(), this->ScrollingPercent() );
}
2003-01-02 02:59:35 +00:00
m_BackBanner.SetDiffuse( RageColor(1,1,1,1) );
m_BackBanner.StopTweening();
m_BackBanner.BeginTweening( 0.25f ); // fade out
m_BackBanner.SetTweenDiffuse( RageColor(1,1,1,0) );
2002-08-21 07:59:04 +00:00
}