combo graph metricing

This commit is contained in:
Glenn Maynard
2003-12-28 06:00:27 +00:00
parent 1e57d5681d
commit 57e85031b2
3 changed files with 21 additions and 8 deletions
+17 -6
View File
@@ -3,12 +3,13 @@
#include "ThemeManager.h"
#include "RageLog.h"
#include "StageStats.h"
#include "ActorUtil.h"
const int MinComboSizeToShow = 5;
void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn )
{
ASSERT( m_Actors.size() == 0 );
ASSERT( m_SubActors.size() == 0 );
/* Find the largest combo. */
int MaxComboSize = 0;
@@ -27,6 +28,7 @@ void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn )
LOG->Trace("combo %i is %f+%f", i, combo.start, combo.size);
Sprite *sprite = new Sprite;
sprite->SetName( "ComboBar" );
const CString path = ssprintf( "%s %s", Path.c_str(), IsMax? "max":"normal" );
sprite->Load( THEME->GetPathToG(path) );
@@ -42,7 +44,7 @@ void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn )
if( width < 0 )
width = sprite->GetUnzoomedWidth();
m_Actors.push_back( sprite );
m_Sprites.push_back( sprite );
this->AddChild( sprite );
}
@@ -60,6 +62,7 @@ void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn )
continue;
BitmapText *text = new BitmapText;
text->SetName( "ComboMaxNumber" );
text->LoadFromFont( THEME->GetPathToF(Path) );
const float start = SCALE( combo.start, s.fFirstPos[pn], s.fLastPos[pn], 0.0f, 1.0f );
@@ -70,18 +73,26 @@ void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn )
text->SetX( CenterXPos );
text->SetText( ssprintf("%i",combo.GetStageCnt()) );
text->Command( "diffusealpha,0;sleep,.5f;linear,.3;diffusealpha,1" );
ON_COMMAND( text );
m_Actors.push_back( text );
m_Numbers.push_back( text );
this->AddChild( text );
}
}
void ComboGraph::TweenOffScreen()
{
for( unsigned i = 0; i < m_SubActors.size(); ++i )
OFF_COMMAND( m_SubActors[i] );
}
void ComboGraph::Unload()
{
for( unsigned i = 0; i < m_Actors.size(); ++i )
delete m_Actors[i];
for( unsigned i = 0; i < m_SubActors.size(); ++i )
delete m_SubActors[i];
m_Sprites.clear();
m_Numbers.clear();
m_SubActors.clear();
}