Files
itgmania212121/stepmania/src/FootMeter.cpp
T

63 lines
1.3 KiB
C++
Raw Normal View History

2002-01-16 10:01:32 +00:00
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
2002-05-27 08:23:27 +00:00
Class: FootMeter
2002-01-16 10:01:32 +00:00
2002-05-27 08:23:27 +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.
2002-05-27 08:23:27 +00:00
Chris Danford
2002-01-16 10:01:32 +00:00
-----------------------------------------------------------------------------
*/
#include "FootMeter.h"
#include "RageUtil.h"
2002-05-01 19:14:55 +00:00
#include "GameConstantsAndTypes.h"
2002-07-23 01:41:40 +00:00
#include "PrefsManager.h"
2002-01-16 10:01:32 +00:00
2002-05-19 01:59:48 +00:00
FootMeter::FootMeter()
{
BitmapText::LoadFromTextureAndChars( THEME->GetPathTo("Graphics","select music meter 2x1"), "10" );
2002-05-19 01:59:48 +00:00
2002-06-27 17:49:10 +00:00
SetFromNotes( NULL );
2002-05-19 01:59:48 +00:00
}
void FootMeter::SetFromNotes( Notes* pNotes )
{
if( pNotes != NULL )
{
SetDiffuse( D3DXCOLOR(1,1,1,1) );
2002-06-27 17:49:10 +00:00
SetNumFeet( pNotes->m_iMeter );
2002-05-19 01:59:48 +00:00
if( pNotes->m_iMeter >= 10 )
this->SetEffectGlowing();
else
this->SetEffectNone();
2002-06-23 11:43:53 +00:00
SetDiffuse( pNotes->GetColor() );
2002-06-23 11:43:53 +00:00
this->StopTweening();
this->SetZoom( 1.1f );
this->BeginTweening( 0.3f, TWEEN_BOUNCE_BEGIN );
this->SetTweenZoom( 1 );
2002-05-19 01:59:48 +00:00
}
else
{
2002-06-14 22:25:22 +00:00
this->SetEffectNone();
SetDiffuse( D3DXCOLOR(0.8f,0.8f,0.8f,1) );
2002-06-27 17:49:10 +00:00
SetNumFeet( 0 );
2002-05-19 01:59:48 +00:00
}
}
2002-06-27 17:49:10 +00:00
void FootMeter::SetNumFeet( int iNumFeet )
2002-05-19 01:59:48 +00:00
{
CString sNewText;
2002-09-10 03:09:02 +00:00
for( int f=0; f<=9; f++ )
2002-05-19 01:59:48 +00:00
sNewText += (f<iNumFeet) ? "1" : "0";
2002-09-10 03:09:02 +00:00
for( f=10; f<=12; f++ )
2002-05-19 01:59:48 +00:00
if( f<iNumFeet )
sNewText += "1";
SetText( sNewText );
}