don't allow stalling the music select timer indefinitely

This commit is contained in:
Glenn Maynard
2003-12-03 03:03:54 +00:00
parent 3cbe471e24
commit 271fb872fb
2 changed files with 12 additions and 3 deletions
+11 -2
View File
@@ -25,11 +25,13 @@
#define WARNING_COMMAND(i) THEME->GetMetric ("MenuTimer", ssprintf("WarningCommand%i",i))
#define ON_COMMAND THEME->GetMetric ("MenuTimer","OnCommand")
const int TIMER_SECONDS = 99;
static const int TIMER_SECONDS = 99;
static const int MAX_STALL_SECONDS = 30;
MenuTimer::MenuTimer()
{
m_fStallSeconds = 0;
m_fStallSecondsLeft = MAX_STALL_SECONDS;
m_bPaused = false;
m_textDigit1.LoadFromNumbers( THEME->GetPathToN("MenuTimer") );
@@ -125,7 +127,14 @@ void MenuTimer::Disable()
void MenuTimer::Stall()
{
m_fStallSeconds = 0.5f;
/* Max amount of stall time we'll use: */
const float Amt = min( 0.5f, m_fStallSecondsLeft );
/* Amount of stall time to add: */
const float ToAdd = Amt - m_fStallSeconds;
m_fStallSeconds += ToAdd;
m_fStallSecondsLeft -= ToAdd;
}
void MenuTimer::SetSeconds( int iSeconds )
+1 -1
View File
@@ -35,7 +35,7 @@ public:
protected:
float m_fSecondsLeft;
float m_fStallSeconds;
float m_fStallSeconds, m_fStallSecondsLeft;
bool m_bPaused;
void SetText( int iSeconds );