Files
itgmania212121/stepmania/src/TransitionFade.cpp
T

44 lines
857 B
C++
Raw Normal View History

2001-11-03 10:52:42 +00:00
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
2002-08-01 03:15:27 +00:00
Class: TransitionFade
2002-08-01 03:15:27 +00:00
Desc: See header.
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-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) );
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
{
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
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
}