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-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
|
|
|
|
#include "Notes.h"
|
2002-01-16 10:01:32 +00:00
|
|
|
|
|
|
|
|
|
2002-10-06 16:56:58 +00:00
|
|
|
const int NUM_FEET_IN_METER = 10;
|
|
|
|
|
const int GLOW_IF_METER_GREATER_THAN = 9;
|
|
|
|
|
|
2002-01-16 10:01:32 +00:00
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
FootMeter::FootMeter()
|
|
|
|
|
{
|
2002-09-03 22:31:06 +00:00
|
|
|
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 )
|
|
|
|
|
{
|
2002-10-28 05:30:45 +00:00
|
|
|
SetDiffuse( RageColor(1,1,1,1) );
|
2003-01-02 22:10:51 +00:00
|
|
|
SetNumFeet( pNotes->GetMeter() );
|
|
|
|
|
if( pNotes->GetMeter() > GLOW_IF_METER_GREATER_THAN )
|
2002-05-19 01:59:48 +00:00
|
|
|
this->SetEffectGlowing();
|
|
|
|
|
else
|
|
|
|
|
this->SetEffectNone();
|
2002-06-23 11:43:53 +00:00
|
|
|
|
2002-09-02 21:59:58 +00:00
|
|
|
SetDiffuse( pNotes->GetColor() );
|
2002-05-19 01:59:48 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2002-06-14 22:25:22 +00:00
|
|
|
this->SetEffectNone();
|
2002-10-28 05:30:45 +00:00
|
|
|
SetDiffuse( RageColor(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-11-16 08:54:15 +00:00
|
|
|
int f;
|
|
|
|
|
for( f=0; f<NUM_FEET_IN_METER; f++ )
|
2002-05-19 01:59:48 +00:00
|
|
|
sNewText += (f<iNumFeet) ? "1" : "0";
|
2002-10-06 16:56:58 +00:00
|
|
|
for( f=NUM_FEET_IN_METER; f<=13; f++ )
|
2002-05-19 01:59:48 +00:00
|
|
|
if( f<iNumFeet )
|
|
|
|
|
sNewText += "1";
|
|
|
|
|
|
|
|
|
|
SetText( sNewText );
|
2002-11-16 08:54:15 +00:00
|
|
|
}
|