Files
itgmania212121/stepmania/src/MusicStatusDisplay.h
T

100 lines
2.0 KiB
C++
Raw Normal View History

2002-01-16 10:01:32 +00:00
/*
-----------------------------------------------------------------------------
File: MusicStatusDisplay.h
Desc: A graphic displayed in the MusicStatusDisplay during Dancing.
2002-05-19 01:59:48 +00:00
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
2002-01-16 10:01:32 +00:00
-----------------------------------------------------------------------------
*/
class MusicStatusDisplay;
#ifndef _MusicStatusDisplay_H_
#define _MusicStatusDisplay_H_
#include "Sprite.h"
#include "ThemeManager.h"
enum MusicStatusDisplayType { TYPE_NEW, TYPE_NONE, TYPE_CROWN1, TYPE_CROWN2, TYPE_CROWN3 };
2002-01-16 10:01:32 +00:00
class MusicStatusDisplay : public Sprite
{
public:
MusicStatusDisplay()
{
Load( THEME->GetPathTo(GRAPHIC_MUSIC_STATUS_ICONS) );
StopAnimating();
SetType( TYPE_NONE );
};
2002-01-16 10:01:32 +00:00
void SetType( MusicStatusDisplayType msdt )
2002-01-16 10:01:32 +00:00
{
m_MusicStatusDisplayType = msdt;
switch( m_MusicStatusDisplayType )
2002-01-16 10:01:32 +00:00
{
case TYPE_NEW:
m_MusicStatusDisplayType = TYPE_NEW;
SetState( 0 );
SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
break;
case TYPE_CROWN1:
m_MusicStatusDisplayType = TYPE_CROWN1;
SetState( 1 );
SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
break;
case TYPE_CROWN2:
m_MusicStatusDisplayType = TYPE_CROWN2;
SetState( 2 );
SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
break;
case TYPE_CROWN3:
m_MusicStatusDisplayType = TYPE_CROWN3;
SetState( 3 );
SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
break;
case TYPE_NONE:
default:
m_MusicStatusDisplayType = TYPE_NONE;
SetDiffuseColor( D3DXCOLOR(0,0,0,0) );
break;
2002-01-16 10:01:32 +00:00
}
};
2002-01-16 10:01:32 +00:00
virtual void Update( float fDeltaTime )
{
Sprite::Update( fDeltaTime );
2002-02-10 06:25:12 +00:00
};
2002-05-19 01:59:48 +00:00
virtual void DrawPrimitives()
2002-02-10 06:25:12 +00:00
{
switch( m_MusicStatusDisplayType )
2002-01-16 10:01:32 +00:00
{
case TYPE_CROWN1:
case TYPE_CROWN2:
case TYPE_CROWN3:
// blink
2002-01-16 10:01:32 +00:00
if( (GetTickCount() % 1000) > 500 ) // show the new icon
2002-02-10 06:25:12 +00:00
return;
break;
case TYPE_NONE:
return;
2002-02-10 06:25:12 +00:00
break;
}
2002-05-19 01:59:48 +00:00
Sprite::DrawPrimitives();
}
2002-01-16 10:01:32 +00:00
protected:
enum MusicStatusDisplayType m_MusicStatusDisplayType;
2002-01-16 10:01:32 +00:00
};
#endif