2001-11-03 10:52:42 +00:00
|
|
|
#include "stdafx.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-01-16 10:01:32 +00:00
|
|
|
m_rect.StretchTo( CRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT) );
|
2002-09-02 21:59:58 +00:00
|
|
|
SetDiffuse( D3DXCOLOR(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-03-30 20:00:13 +00:00
|
|
|
const 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-09-02 21:59:58 +00:00
|
|
|
D3DXCOLOR colorTemp = GetDiffuse() * fPercentageOpaque;
|
|
|
|
|
m_rect.SetDiffuse( colorTemp );
|
2002-01-16 10:01:32 +00:00
|
|
|
m_rect.Draw();
|
2001-11-03 10:52:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|