Files
itgmania212121/stepmania/src/MusicStatusDisplay.cpp
T

82 lines
1.4 KiB
C++
Raw Normal View History

2002-01-16 10:01:32 +00:00
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: MusicStatusDisplay
2002-01-16 10:01:32 +00:00
Desc: See header.
2002-01-16 10:01:32 +00:00
2002-05-19 01:59:48 +00:00
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
2002-01-16 10:01:32 +00:00
-----------------------------------------------------------------------------
*/
#include "MusicStatusDisplay.h"
#include "RageUtil.h"
2002-05-01 19:14:55 +00:00
#include "GameConstantsAndTypes.h"
2002-01-16 10:01:32 +00:00
#include "MusicWheel.h"
#include "MusicStatusDisplay.h"
2002-07-27 19:29:51 +00:00
#include "RageTimer.h"
2002-01-16 10:01:32 +00:00
2002-07-27 19:29:51 +00:00
MusicStatusDisplay::MusicStatusDisplay()
{
2002-08-20 21:00:56 +00:00
Load( THEME->GetPathTo("Graphics","music status icons 1x4") );
2002-07-27 19:29:51 +00:00
StopAnimating();
2002-01-16 10:01:32 +00:00
2002-08-20 21:00:56 +00:00
SetType( none );
}
2002-01-16 10:01:32 +00:00
2002-08-20 21:00:56 +00:00
void MusicStatusDisplay::SetType( IconType type )
2002-07-27 19:29:51 +00:00
{
2002-08-20 21:00:56 +00:00
m_type = type;
2002-07-27 19:29:51 +00:00
SetDiffuse( RageColor(1,1,1,1) );
2002-08-20 21:00:56 +00:00
switch( type )
2002-07-27 19:29:51 +00:00
{
2002-08-20 21:00:56 +00:00
case none:
SetEffectNone();
SetDiffuse( RageColor(1,1,1,0) );
2002-08-20 21:00:56 +00:00
break;
case easy:
SetEffectNone();
2002-07-27 19:29:51 +00:00
SetState( 0 );
break;
2002-08-20 21:00:56 +00:00
case crown1:
2002-07-27 19:29:51 +00:00
SetState( 1 );
break;
2002-08-20 21:00:56 +00:00
case crown2:
2002-07-27 19:29:51 +00:00
SetState( 2 );
break;
2002-08-20 21:00:56 +00:00
case crown3:
2002-07-27 19:29:51 +00:00
SetState( 3 );
break;
default:
2002-08-20 21:00:56 +00:00
ASSERT(0);
2002-07-27 19:29:51 +00:00
}
2002-08-20 21:00:56 +00:00
}
2002-07-27 19:29:51 +00:00
void MusicStatusDisplay::Update( float fDeltaTime )
{
Sprite::Update( fDeltaTime );
2002-08-20 21:00:56 +00:00
}
2002-07-27 19:29:51 +00:00
void MusicStatusDisplay::DrawPrimitives()
{
2002-08-20 21:00:56 +00:00
switch( m_type )
2002-07-27 19:29:51 +00:00
{
2002-08-20 21:00:56 +00:00
case none:
case easy:
2002-07-27 19:29:51 +00:00
break;
2002-08-20 21:00:56 +00:00
case crown1:
case crown2:
case crown3:
if( fmodf(TIMER->GetTimeSinceStart(), 1) > 0.5f )
return; // blink
2002-07-27 19:29:51 +00:00
break;
2002-08-20 21:00:56 +00:00
default:
ASSERT(0);
2002-07-27 19:29:51 +00:00
}
Sprite::DrawPrimitives();
}