diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 3594673dfb..8a27ef4e3c 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,9 +8,14 @@ ________________________________________________________________________________ StepMania 5.0 $next | 20111xxx -------------------------------------------------------------------------------- +2011/12/16 +---------- +* [StreamDisplay] Added VelocityMultiplier, VelocityMin, VelocityMax, + SpringMultiplier and ViscosityMultiplier metrics. [AJ] + 2011/12/12 ---------- -* [ScreenEdit] Add the GAMESTATE:InStepEditor LUA binding. [Wolfman2000] +* [ScreenEdit] Add the GAMESTATE:InStepEditor Lua binding. [Wolfman2000] * [Player, ScreenGameplay] Allow failing on Oni without crashing. This one took awhile. [Wolfman2000] * [LifeMeterBattery] Fixed various issues (lives not fully disappearing on fail, diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 6f3ad1c887..03358b936a 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -1339,6 +1339,11 @@ NumPills=20 UseThreePartMethod=false ThreePartWidth=128 AlwaysBounceNormalBar=false +VelocityMultiplier=4 +VelocityMin=-.06 +VelocityMax=.02 +SpringMultiplier=2.0 +ViscosityMultiplier=0.2 [TextBanner] TitleOnCommand= diff --git a/src/StreamDisplay.cpp b/src/StreamDisplay.cpp index b86ea79b5f..007642f9da 100644 --- a/src/StreamDisplay.cpp +++ b/src/StreamDisplay.cpp @@ -29,6 +29,11 @@ void StreamDisplay::Load( const RString &_sMetricsGroup ) RString sMetricsGroup = "StreamDisplay"; m_transformPill.SetFromReference( THEME->GetMetricR(sMetricsGroup,"PillTransformFunction") ); + VELOCITY_MULTIPLIER.Load(sMetricsGroup, "VelocityMultiplier"); + VELOCITY_MIN.Load(sMetricsGroup, "VelocityMin"); + VELOCITY_MAX.Load(sMetricsGroup, "VelocityMax"); + SPRING_MULTIPLIER.Load(sMetricsGroup, "SpringMultiplier"); + VISCOSITY_MULTIPLIER.Load(sMetricsGroup, "ViscosityMultiplier"); float fTextureCoordScaleX = THEME->GetMetricF(sMetricsGroup,"TextureCoordScaleX"); int iNumPills = static_cast(THEME->GetMetricF(sMetricsGroup,"NumPills")); @@ -71,19 +76,19 @@ void StreamDisplay::Update( float fDeltaSecs ) if( fabsf(fDelta) < 0.00001f ) m_fVelocity = 0; // prevent div/0 else - m_fVelocity = (fDelta / fabsf(fDelta)) * 4; + m_fVelocity = (fDelta / fabsf(fDelta)) * VELOCITY_MULTIPLIER; } else { - const float fSpringForce = fDelta * 2.0f; + const float fSpringForce = fDelta * SPRING_MULTIPLIER; m_fVelocity += fSpringForce * fDeltaSecs; - const float fViscousForce = -m_fVelocity * 0.2f; + const float fViscousForce = -m_fVelocity * VISCOSITY_MULTIPLIER; if( !m_bAlwaysBounce ) m_fVelocity += fViscousForce * fDeltaSecs; } - CLAMP( m_fVelocity, -.06f, +.02f ); + CLAMP( m_fVelocity, VELOCITY_MIN, VELOCITY_MAX ); m_fTrailingPercent += m_fVelocity * fDeltaSecs; } diff --git a/src/StreamDisplay.h b/src/StreamDisplay.h index 71a28aca69..90aeb705a3 100644 --- a/src/StreamDisplay.h +++ b/src/StreamDisplay.h @@ -6,6 +6,7 @@ #include "Sprite.h" #include "Quad.h" #include "LuaExpressionTransform.h" +#include "ThemeMetric.h" enum StreamType { @@ -34,6 +35,11 @@ private: vector m_vpSprPill[NUM_StreamType]; LuaExpressionTransform m_transformPill; // params: self,offsetFromCenter,itemIndex,numItems + ThemeMetric VELOCITY_MULTIPLIER; + ThemeMetric VELOCITY_MIN; + ThemeMetric VELOCITY_MAX; + ThemeMetric SPRING_MULTIPLIER; + ThemeMetric VISCOSITY_MULTIPLIER; float m_fPercent; // percent filled float m_fTrailingPercent; // this approaches m_fPercent, use this value to draw