From a28355ec11fdc45b50c28209342aa7aa57af9fc8 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 23 Feb 2003 01:32:39 +0000 Subject: [PATCH] changed BPMDisplay to use a Numbers graphic instead of a Font --- stepmania/Themes/default/metrics.ini | 9 ++-- stepmania/src/BPMDisplay.cpp | 63 ++++++++++------------------ stepmania/src/BPMDisplay.h | 11 ++--- 3 files changed, 28 insertions(+), 55 deletions(-) diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index ec7e86751f..a8fb0944d2 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -702,12 +702,9 @@ StageTextExtra1=Extra StageTextExtra2=Extra2 [BPMDisplay] -NormalColorTop=1.0,1.0,0.0,1 // yellow -NormalColorBottom=1.0,0.5,0.0,1 // orange -ChangeColorTop=1.0,0.0,0.0,1 // red -ChangeColorBottom=0.6,0.0,0.0,1 // dark red -ExtraColorTop=1.0,0.0,0.0,1 // red -ExtraColorBottom=0.6,0.0,0.0,1 // dark red +NormalColor=1.0,0.5,0.0,1 // orange +ChangeColor=0.6,0.0,0.0,1 // dark red +ExtraColor=0.6,0.0,0.0,1 // dark red [GrayArrow] StepZoom=0.75 diff --git a/stepmania/src/BPMDisplay.cpp b/stepmania/src/BPMDisplay.cpp index 2d904e8a35..7370322628 100644 --- a/stepmania/src/BPMDisplay.cpp +++ b/stepmania/src/BPMDisplay.cpp @@ -17,12 +17,9 @@ #include "ThemeManager.h" -#define NORMAL_COLOR_TOP THEME->GetMetricC("BPMDisplay","NormalColorTop") -#define NORMAL_COLOR_BOTTOM THEME->GetMetricC("BPMDisplay","NormalColorBottom") -#define CHANGE_COLOR_TOP THEME->GetMetricC("BPMDisplay","ChangeColorTop") -#define CHANGE_COLOR_BOTTOM THEME->GetMetricC("BPMDisplay","ChangeColorBottom") -#define EXTRA_COLOR_TOP THEME->GetMetricC("BPMDisplay","ExtraColorTop") -#define EXTRA_COLOR_BOTTOM THEME->GetMetricC("BPMDisplay","ExtraColorBottom") +#define NORMAL_COLOR THEME->GetMetricC("BPMDisplay","NormalColor") +#define CHANGE_COLOR THEME->GetMetricC("BPMDisplay","ChangeColor") +#define EXTRA_COLOR THEME->GetMetricC("BPMDisplay","ExtraColor") BPMDisplay::BPMDisplay() @@ -32,32 +29,20 @@ BPMDisplay::BPMDisplay() m_fTimeLeftInState = 0; m_bExtraStage = GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2(); - m_rectFrame.SetDiffuse( RageColor(0,0,0,0.3f) ); - m_rectFrame.SetZoomX( 120 ); - m_rectFrame.SetZoomY( 40 ); - - m_textBPM.LoadFromFont( THEME->GetPathTo("Fonts","bpmdisplay") ); + m_textBPM.LoadFromNumbers( THEME->GetPathTo("Numbers","select music bpm numbers") ); m_textBPM.TurnShadowOff(); - m_textBPM.SetXY( CENTER_X, SCREEN_HEIGHT - 50 ); - //m_textBPM.SetSequence( ssprintf("999") ); - m_textBPM.SetXY( -23, 0 ); - m_textBPM.SetZoom( 1.0f ); - m_textBPM.SetDiffuseTopEdge( NORMAL_COLOR_TOP ); // yellow - m_textBPM.SetDiffuseBottomEdge( NORMAL_COLOR_BOTTOM ); // orange + m_textBPM.SetHorizAlign( Actor::align_right ); + m_textBPM.SetDiffuse( NORMAL_COLOR ); + m_sprLabel.SetXY( 0, 0 ); - m_textLabel.LoadFromFont( THEME->GetPathTo("Fonts","bpmdisplay") ); - m_textLabel.TurnShadowOff(); - m_textLabel.SetXY( 34, 2 ); - m_textLabel.SetText( "BPM" ); + m_sprLabel.Load( THEME->GetPathTo("Graphics","select music bpm label") ); + m_sprLabel.TurnShadowOff(); + m_sprLabel.SetDiffuse( NORMAL_COLOR ); + m_sprLabel.SetHorizAlign( Actor::align_left ); + m_sprLabel.SetXY( 0, 0 ); - m_textLabel.SetZoom( 0.7f ); - m_textLabel.SetZoomX( 0.5f ); - m_textLabel.SetDiffuseTopEdge( NORMAL_COLOR_TOP ); // yellow - m_textLabel.SetDiffuseBottomEdge( NORMAL_COLOR_BOTTOM ); // orange - - //this->AddChild( &m_rectFrame ); this->AddChild( &m_textBPM ); - this->AddChild( &m_textLabel ); + this->AddChild( &m_sprLabel ); } @@ -113,30 +98,24 @@ void BPMDisplay::SetBPMRange( float fLowBPM, float fHighBPM ) m_fTimeLeftInState = 1; m_textBPM.StopTweening(); - m_textLabel.StopTweening(); + m_sprLabel.StopTweening(); m_textBPM.BeginTweening(0.5f); - m_textLabel.BeginTweening(0.5f); + m_sprLabel.BeginTweening(0.5f); if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() ) { - m_textBPM.SetTweenDiffuseTopEdge( EXTRA_COLOR_TOP ); - m_textBPM.SetTweenDiffuseBottomEdge( EXTRA_COLOR_BOTTOM ); - m_textLabel.SetTweenDiffuseTopEdge( EXTRA_COLOR_TOP ); - m_textLabel.SetTweenDiffuseBottomEdge( EXTRA_COLOR_BOTTOM ); + m_textBPM.SetTweenDiffuseTopEdge( EXTRA_COLOR ); + m_sprLabel.SetTweenDiffuseBottomEdge( EXTRA_COLOR ); } else if( m_fLowBPM != m_fHighBPM ) { - m_textBPM.SetTweenDiffuseTopEdge( CHANGE_COLOR_TOP ); - m_textBPM.SetTweenDiffuseBottomEdge( CHANGE_COLOR_BOTTOM ); - m_textLabel.SetTweenDiffuseTopEdge( CHANGE_COLOR_TOP ); - m_textLabel.SetTweenDiffuseBottomEdge( CHANGE_COLOR_BOTTOM ); + m_textBPM.SetTweenDiffuseTopEdge( CHANGE_COLOR ); + m_sprLabel.SetTweenDiffuseBottomEdge( CHANGE_COLOR ); } else { - m_textBPM.SetTweenDiffuseTopEdge( NORMAL_COLOR_TOP ); - m_textBPM.SetTweenDiffuseBottomEdge( NORMAL_COLOR_BOTTOM ); - m_textLabel.SetTweenDiffuseTopEdge( NORMAL_COLOR_TOP ); - m_textLabel.SetTweenDiffuseBottomEdge( NORMAL_COLOR_BOTTOM ); + m_textBPM.SetTweenDiffuseTopEdge( NORMAL_COLOR ); + m_sprLabel.SetTweenDiffuseBottomEdge( NORMAL_COLOR ); } } diff --git a/stepmania/src/BPMDisplay.h b/stepmania/src/BPMDisplay.h index eb8b6abb7b..a14342965e 100644 --- a/stepmania/src/BPMDisplay.h +++ b/stepmania/src/BPMDisplay.h @@ -1,3 +1,5 @@ +#ifndef _BPMDisplay_H_ +#define _BPMDisplay_H_ /* ----------------------------------------------------------------------------- File: BPMDisplay.h @@ -5,14 +7,10 @@ Desc: A graphic displayed in the BPMDisplay during Dancing. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ - -#ifndef _BPMDisplay_H_ -#define _BPMDisplay_H_ - - #include "Sprite.h" #include "song.h" #include "ActorFrame.h" @@ -29,8 +27,7 @@ public: protected: BitmapText m_textBPM; - BitmapText m_textLabel; - Quad m_rectFrame; + Sprite m_sprLabel; float m_fCurrentBPM; float m_fLowBPM, m_fHighBPM;