2002-08-13 23:26:46 +00:00
|
|
|
#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
|
2002-08-13 23:26:46 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#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 );
|
2002-08-13 23:26:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FadingBanner::Update( float fDeltaTime )
|
|
|
|
|
{
|
2003-01-02 02:59:35 +00:00
|
|
|
m_BackBanner.Update(fDeltaTime);
|
|
|
|
|
Banner::Update( fDeltaTime );
|
2002-08-13 23:26:46 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-02 02:59:35 +00:00
|
|
|
void FadingBanner::DrawPrimitives()
|
2002-08-13 23:26:46 +00:00
|
|
|
{
|
2003-01-02 02:59:35 +00:00
|
|
|
Banner::DrawPrimitives();
|
|
|
|
|
m_BackBanner.Draw();
|
2002-08-13 23:26:46 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-02 02:59:35 +00:00
|
|
|
bool FadingBanner::Load( RageTextureID ID )
|
2002-08-13 23:26:46 +00:00
|
|
|
{
|
|
|
|
|
BeforeChange();
|
2003-01-02 02:59:35 +00:00
|
|
|
return Banner::Load(ID);
|
2002-08-13 23:26:46 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-02 02:59:35 +00:00
|
|
|
void FadingBanner::BeforeChange()
|
2002-08-13 23:26:46 +00:00
|
|
|
{
|
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() );
|
|
|
|
|
}
|
2002-08-13 23:26:46 +00:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|