2001-11-03 10:52:42 +00:00
|
|
|
#include "stdafx.h"
|
2001-11-04 19:34:28 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
File: TransitionFade.cpp
|
|
|
|
|
|
|
|
|
|
Desc: Fades out or in.
|
|
|
|
|
|
2002-04-16 17:31:00 +00:00
|
|
|
Copyright (c) 2001-2002 by the persons listed below. All rights reserved.
|
2001-11-04 19:34:28 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
2001-11-03 10:52:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "RageUtil.h"
|
|
|
|
|
|
|
|
|
|
#include "TransitionFade.h"
|
2002-01-16 10:01:32 +00:00
|
|
|
#include "ScreenDimensions.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) );
|
2001-11-03 10:52:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TransitionFade::~TransitionFade()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2002-01-16 10:01:32 +00:00
|
|
|
void TransitionFade::RenderPrimitives()
|
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
|
|
|
|
2001-12-19 01:50:57 +00:00
|
|
|
D3DXCOLOR colorTemp = m_Color * fPercentageOpaque;
|
2002-01-16 10:01:32 +00:00
|
|
|
m_rect.SetDiffuseColor( colorTemp );
|
|
|
|
|
m_rect.Draw();
|
2001-11-03 10:52:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|