From 8e987d18b60c2651c92aeb63c17ad19bacfc77b5 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 4 May 2005 04:00:00 +0000 Subject: [PATCH] fix warnings --- stepmania/src/BitmapText.cpp | 6 +++--- stepmania/src/MenuTimer.cpp | 33 +++++++++++++++------------------ 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 83e0961e3f..56124739c9 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -380,13 +380,13 @@ void BitmapText::SetText( const CString& _sText, const CString& _sAlternateText, change.l = sEndText.length(); m_vColors.push_back( change ); last = i+9; - if ( last < m_sText.length() ) + if ( last < (int)m_sText.length() ) i = m_sText.Find( CString("|c0"), last ); else i = -1; } - if ( last < m_sText.length() ) + if ( last < (int)m_sText.length() ) sEndText += m_sText.substr( last, m_sText.length()-last ); m_sText = sEndText; @@ -653,7 +653,7 @@ void BitmapText::DrawPrimitives() for( unsigned i=0; i m_vColors[cur].l ) { c = m_vColors[cur].c; diff --git a/stepmania/src/MenuTimer.cpp b/stepmania/src/MenuTimer.cpp index 4b9a8d2e06..f42855ad4b 100644 --- a/stepmania/src/MenuTimer.cpp +++ b/stepmania/src/MenuTimer.cpp @@ -71,39 +71,36 @@ void MenuTimer::Update( float fDeltaTime ) const float fOldSecondsLeft = m_fSecondsLeft; m_fSecondsLeft -= fDeltaTime; + m_fSecondsLeft = max( 0, m_fSecondsLeft ); const float fNewSecondsLeft = m_fSecondsLeft; - const int iOldDisplay = (int)(fOldSecondsLeft + 0.99f); - int iNewDisplay = (int)(fNewSecondsLeft + 0.99f); - iNewDisplay = max( iNewDisplay, 0 ); + if( fOldSecondsLeft == fNewSecondsLeft ) + return; if( fOldSecondsLeft > 5.5 && fNewSecondsLeft < 5.5 ) // transition to below 5.5 SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("hurry up") ); - if( iOldDisplay == iNewDisplay ) - return; + SetText( fNewSecondsLeft ); - SetText( iNewDisplay ); - - if( iNewDisplay <= WARNING_START ) + for( int s=0; s s && fNewSecondsLeft < s ) // crossed + { + for( int i=0; iPostMessageToTopScreen( SM_MenuTimer, 0 ); for( int i=0; i