2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2001-11-04 19:34:28 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
2002-08-01 03:15:27 +00:00
|
|
|
Class: TransitionFade
|
2001-11-04 19:34:28 +00:00
|
|
|
|
2002-08-01 03:15:27 +00:00
|
|
|
Desc: See header.
|
2001-11-04 19:34:28 +00:00
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-08-01 03:15:27 +00:00
|
|
|
Chris Danford
|
2001-11-04 19:34:28 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
2001-11-03 10:52:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "RageUtil.h"
|
|
|
|
|
|
|
|
|
|
#include "TransitionFade.h"
|
2002-05-01 19:14:55 +00:00
|
|
|
#include "GameConstantsAndTypes.h"
|
2001-11-03 10:52:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TransitionFade::TransitionFade()
|
|
|
|
|
{
|
2002-10-31 05:52:12 +00:00
|
|
|
m_rect.StretchTo( RectI(0,0,SCREEN_WIDTH,SCREEN_HEIGHT) );
|
2002-10-28 05:30:45 +00:00
|
|
|
SetDiffuse( RageColor(0,0,0,1) ); // black
|
2001-11-03 10:52:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TransitionFade::~TransitionFade()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
void TransitionFade::DrawPrimitives()
|
2001-11-03 10:52:42 +00:00
|
|
|
{
|
2002-11-13 05:17:15 +00:00
|
|
|
float fPercentageOpaque = 1 - GetPercentageOpen();
|
2002-01-16 10:01:32 +00:00
|
|
|
if( fPercentageOpaque == 0 )
|
|
|
|
|
return; // draw nothing
|
2001-11-03 10:52:42 +00:00
|
|
|
|
2002-11-13 05:17:15 +00:00
|
|
|
CLAMP( fPercentageOpaque, 0, 1 );
|
|
|
|
|
|
2002-10-28 05:30:45 +00:00
|
|
|
RageColor colorTemp = GetDiffuse();
|
2003-01-30 07:18:33 +00:00
|
|
|
colorTemp.a *= fPercentageOpaque;
|
2002-09-02 21:59:58 +00:00
|
|
|
m_rect.SetDiffuse( colorTemp );
|
2002-01-16 10:01:32 +00:00
|
|
|
m_rect.Draw();
|
2001-11-03 10:52:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|