simplify and fix up combo/life stats

This commit is contained in:
Glenn Maynard
2003-12-22 01:55:03 +00:00
parent 13d6ec2284
commit a1458b2095
7 changed files with 145 additions and 74 deletions
+10 -5
View File
@@ -29,12 +29,14 @@ void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn )
const CString path = ssprintf( "%s %s", Path.c_str(), IsMax? "max":"normal" );
sprite->Load( THEME->GetPathToG(path) );
sprite->SetCropLeft ( SCALE( combo.size, 0.0f, 1.0f, 0.5f, 0.0f ) );
sprite->SetCropRight( SCALE( combo.size, 0.0f, 1.0f, 0.5f, 0.0f ) );
const float start = SCALE( combo.start, s.fFirstPos[pn], s.fLastPos[pn], 0.0f, 1.0f );
const float size = SCALE( combo.size, 0, s.fLastPos[pn]-s.fFirstPos[pn], 0.0f, 1.0f );
sprite->SetCropLeft ( SCALE( size, 0.0f, 1.0f, 0.5f, 0.0f ) );
sprite->SetCropRight( SCALE( size, 0.0f, 1.0f, 0.5f, 0.0f ) );
sprite->BeginTweening( .5f );
sprite->SetCropLeft( combo.start );
sprite->SetCropRight( 1 - (combo.size + combo.start) );
sprite->SetCropLeft( start );
sprite->SetCropRight( 1 - (size + start) );
if( width < 0 )
width = sprite->GetUnzoomedWidth();
@@ -56,7 +58,10 @@ void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn )
BitmapText *text = new BitmapText;
text->LoadFromFont( THEME->GetPathToF(Path) );
const float CenterPercent = combo.start + combo.size/2;
const float start = SCALE( combo.start, s.fFirstPos[pn], s.fLastPos[pn], 0.0f, 1.0f );
const float size = SCALE( combo.size, 0, s.fLastPos[pn]-s.fFirstPos[pn], 0.0f, 1.0f );
const float CenterPercent = start + size/2;
const float CenterXPos = SCALE( CenterPercent, 0.0f, 1.0f, -width/2.0f, width/2.0f );
text->SetX( CenterXPos );