From a77a947dd06431e0929dc0eb7a57766ea3065f25 Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Wed, 26 Jan 2005 14:08:02 +0000 Subject: [PATCH] Change: MUCH Cleaner fix for lifebar. --- stepmania/src/LifeMeterBar.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index 71f1bbbd08..805b477c24 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -495,14 +495,6 @@ bool LifeMeterBar::IsFailing() const void LifeMeterBar::Update( float fDeltaTime ) { - // HACK: Prevent 'Dead on Start' appearance - // the way the physics work, if there is an unusually - // larget delta, it will cause the meter to have a very - // strange effect. - // - if ( fDeltaTime >= 2.0 ) - return; - LifeMeter::Update( fDeltaTime ); @@ -524,6 +516,10 @@ void LifeMeterBar::Update( float fDeltaTime ) m_fTrailingLifePercentage += m_fLifeVelocity * fDeltaTime; } + + //It doesn't make sense to have a heavily negetive + //or heavily overloaded lifebar. + CLAMP( m_fTrailingLifePercentage, -0.1f, 2.0f ); m_fPassingAlpha += IsPastPassmark() ? +fDeltaTime*2 : -fDeltaTime*2; CLAMP( m_fPassingAlpha, 0, 1 );