diff --git a/stepmania/src/MeterDisplay.cpp b/stepmania/src/MeterDisplay.cpp index 248a177180..caace5c566 100644 --- a/stepmania/src/MeterDisplay.cpp +++ b/stepmania/src/MeterDisplay.cpp @@ -15,15 +15,18 @@ MeterDisplay::MeterDisplay() { this->AddChild( &m_sprStream ); + this->AddChild( &m_sprTip ); } -void MeterDisplay::Load( CString sStreamPath, float fStreamWidth ) +void MeterDisplay::Load( CString sStreamPath, float fStreamWidth, CString sTipPath ) { m_fStreamWidth = fStreamWidth; m_sprStream.Load( sStreamPath ); m_sprStream.SetZoomX( fStreamWidth / m_sprStream.GetUnzoomedWidth() ); + m_sprTip.Load( sTipPath ); + SetPercent( 0.5f ); } @@ -32,4 +35,6 @@ void MeterDisplay::SetPercent( float fPercent ) ASSERT( fPercent >= 0 && fPercent <= 1 ); m_sprStream.SetCropRight( 1-fPercent ); + + m_sprTip.SetX( SCALE(fPercent, 0.f, 1.f, -m_fStreamWidth/2, m_fStreamWidth/2) ); } diff --git a/stepmania/src/MeterDisplay.h b/stepmania/src/MeterDisplay.h index 2b094c4d03..a31ce28c73 100644 --- a/stepmania/src/MeterDisplay.h +++ b/stepmania/src/MeterDisplay.h @@ -20,7 +20,7 @@ class MeterDisplay : public ActorFrame { public: MeterDisplay(); - void Load( CString sStreamPath, float fStreamWidth ); + void Load( CString sStreamPath, float fStreamWidth, CString sTipPath = "" ); void SetPercent( float fPercent ); @@ -28,6 +28,7 @@ private: float m_fStreamWidth; float m_fPercent; Sprite m_sprStream; + Sprite m_sprTip; }; #endif diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 37c13a81d5..a0b7c39674 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -422,7 +422,7 @@ ScreenGameplay::ScreenGameplay( CString sName, bool bDemonstration ) : Screen("S this->AddChild( &m_textSongTitle ); - m_meterSongPosition.Load( THEME->GetPathToG("ScreenGameplay song position meter"), SONG_POSITION_METER_WIDTH ); + m_meterSongPosition.Load( THEME->GetPathToG("ScreenGameplay song position meter"), SONG_POSITION_METER_WIDTH, THEME->GetPathToG("ScreenGameplay song position tip") ); m_meterSongPosition.SetName( "SongPositionMeter" ); SET_XY( m_meterSongPosition ); this->AddChild( &m_meterSongPosition );