diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 3af5f8e151..0042ed063c 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -4,6 +4,24 @@ The StepMania 5 Changelog covers all post-sm-ssc changes. For a list of changes from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt. ________________________________________________________________________________ +2016/03/17 +---------- +* [Actor] Added get and set_tween_uses_effect_delta lua functions to make an + Actor use the effect clock for tweening. [kyzentun] + +2016/03/15 +---------- +* [ProfileManager] Added GetStatsPrefix and SetStatsPrefix lua functions for + separating scores into different stats files. [kyzentun] + (this is kind of a stop gap, I'd really like to rewrite scoring to save + more data so that a score earned with one set of timing windows and weights + can be converted to the equivalent score with different timing windows) + +2016/03/14 +---------- +* [Online] Stepmania will force disconnection from the SMO server when + entering the jukebox or sync calibration screens to avoid crash. [kyzentun] + 2016/03/05 ---------- * [global] get_sound_driver_list lua function added. [kyzentun] @@ -31,8 +49,8 @@ ________________________________________________________________________________ the Windows minimaid driver that pkgingo wrote. * [Gameplay] When checking for the first second in a song, AutoKeysound notes are now ignored, being treated as if they were background music. This - allows the intro of BMS files to play as soon as ScreenGameplay is loaded, - while still having a delay before the real notes come in. [nixtrix] + allows the intro of BMS files to play as soon as ScreenGameplay is loaded, + while still having a delay before the real notes come in. [nixtrix] 2016/02/04 ---------- diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml index 3f0a170429..f56bed101f 100644 --- a/Docs/Luadoc/Lua.xml +++ b/Docs/Luadoc/Lua.xml @@ -386,6 +386,7 @@ + @@ -418,6 +419,7 @@ + diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index 918eb6ad54..c203e47a07 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -1225,6 +1225,9 @@ save yourself some time, copy this for undocumented things: Returns the zoomed width of an Actor. + + Returns true if this actor is currently set to use the effect delta for tweening. + Sets the Actor's glow color. @@ -1334,6 +1337,9 @@ save yourself some time, copy this for undocumented things: Sets the width of the Actor. + + Use this to make the actor use the effect clock to tween instead of using the global frame delta. + Sets the shadow's color to c. diff --git a/src/Actor.cpp b/src/Actor.cpp index 55016f2ddb..12c89da0f9 100644 --- a/src/Actor.cpp +++ b/src/Actor.cpp @@ -723,8 +723,25 @@ void Actor::EndDraw() } +void Actor::CalcPercentThroughTween() +{ + TweenState &TS = m_Tweens[0]->state; + TweenInfo &TI = m_Tweens[0]->info; + const float percent_through = 1-(TI.m_fTimeLeftInTween / TI.m_fTweenTime); + // distort the percentage if appropriate + float percent_along = TI.m_pTween->Tween(percent_through); + TweenState::MakeWeightedAverage(m_current, m_start, TS, percent_along); + UpdatePercentThroughTween(percent_along); +} + void Actor::UpdateTweening( float fDeltaTime ) { + if(fDeltaTime < 0.0 && !m_Tweens.empty()) + { + m_Tweens[0]->info.m_fTimeLeftInTween-= fDeltaTime; + CalcPercentThroughTween(); + return; + } while( !m_Tweens.empty() // something to do && fDeltaTime > 0 ) // something will change { @@ -757,12 +774,7 @@ void Actor::UpdateTweening( float fDeltaTime ) } else // in the middle of tweening. Recalcute the current position. { - const float fPercentThroughTween = 1-(TI.m_fTimeLeftInTween / TI.m_fTweenTime); - - // distort the percentage if appropriate - float fPercentAlongPath = TI.m_pTween->Tween( fPercentThroughTween ); - TweenState::MakeWeightedAverage( m_current, m_start, TS, fPercentAlongPath ); - UpdatePercentThroughTween(fPercentAlongPath); + CalcPercentThroughTween(); } if( bBeginning ) @@ -884,6 +896,10 @@ void Actor::UpdateInternal(float delta_time) default: break; } + if(m_tween_uses_effect_delta) + { + delta_time= m_fEffectDelta; + } this->UpdateTweening(delta_time); } @@ -1739,6 +1755,7 @@ public: static int effectclock( T* p, lua_State *L ) { p->SetEffectClockString(SArg(1)); COMMON_RETURN_SELF; } static int effectmagnitude( T* p, lua_State *L ) { p->SetEffectMagnitude( RageVector3(FArg(1),FArg(2),FArg(3)) ); COMMON_RETURN_SELF; } static int geteffectmagnitude( T* p, lua_State *L ) { RageVector3 v = p->GetEffectMagnitude(); lua_pushnumber(L, v[0]); lua_pushnumber(L, v[1]); lua_pushnumber(L, v[2]); return 3; } + GETTER_SETTER_BOOL_METHOD(tween_uses_effect_delta); static int scaletocover( T* p, lua_State *L ) { p->ScaleToCover( RectF(FArg(1), FArg(2), FArg(3), FArg(4)) ); COMMON_RETURN_SELF; } static int scaletofit( T* p, lua_State *L ) { p->ScaleToFitInside( RectF(FArg(1), FArg(2), FArg(3), FArg(4)) ); COMMON_RETURN_SELF; } static int animate( T* p, lua_State *L ) { p->EnableAnimation(BIArg(1)); COMMON_RETURN_SELF; } @@ -2023,6 +2040,7 @@ public: ADD_METHOD( effectclock ); ADD_METHOD( effectmagnitude ); ADD_METHOD( geteffectmagnitude ); + ADD_GET_SET_METHODS(tween_uses_effect_delta); ADD_METHOD( scaletocover ); ADD_METHOD( scaletofit ); ADD_METHOD( animate ); diff --git a/src/Actor.h b/src/Actor.h index fc5c8b9535..08bac90682 100644 --- a/src/Actor.h +++ b/src/Actor.h @@ -281,10 +281,13 @@ public: virtual void Update( float fDeltaTime ); // this can short circuit UpdateInternal virtual void UpdateInternal( float fDeltaTime ); // override this void UpdateTweening( float fDeltaTime ); + void CalcPercentThroughTween(); // These next functions should all be overridden by a derived class that has its own tweening states to handle. virtual void SetCurrentTweenStart() {} virtual void EraseHeadTween() {} virtual void UpdatePercentThroughTween( float PercentThroughTween ) {} + bool get_tween_uses_effect_delta() { return m_tween_uses_effect_delta; } + void set_tween_uses_effect_delta(bool t) { m_tween_uses_effect_delta= t; } /** * @brief Retrieve the Actor's name. @@ -700,6 +703,7 @@ protected: // -Kyz float m_effect_period; EffectClock m_EffectClock; + bool m_tween_uses_effect_delta; /* This can be used in lieu of the fDeltaTime parameter to Update() to * follow the effect clock. Actor::Update must be called first. */