diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 8921211b13..12fa4120e6 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -47,6 +47,13 @@ void Actor::SetBGMLight( int iLightNumber, float fCabinetLights ) } void Actor::InitDefaults() +{ + InitState(); + + UnsubscribeAll(); +} + +void Actor::InitState() { StopTweening(); @@ -88,8 +95,6 @@ void Actor::InitDefaults() m_ZTestMode = ZTEST_OFF; m_bZWrite = false; m_CullMode = CULL_NONE; - - UnsubscribeAll(); } static bool GetMessageNameFromCommandName( const RString &sCommandName, RString &sMessageNameOut ) diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index ef2b82be76..abea52ba56 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -30,6 +30,7 @@ public: virtual ~Actor(); virtual Actor *Copy() const; virtual void InitDefaults(); + virtual void InitState(); virtual void LoadFromNode( const RString& sDir, const XNode* pNode ); bool IsType( const RString &sType ); diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index 7bca64b59a..317d939e21 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -74,6 +74,13 @@ void ActorFrame::InitDefaults() Actor::InitDefaults(); } +void ActorFrame::InitState() +{ + FOREACH( Actor*, m_SubActors, a ) + (*a)->InitState(); + Actor::InitState(); +} + void ActorFrame::LoadFromNode( const RString& sDir, const XNode* pNode ) { if( AutoLoadChildren() ) diff --git a/stepmania/src/ActorFrame.h b/stepmania/src/ActorFrame.h index 48e60297cb..4a59f7afef 100644 --- a/stepmania/src/ActorFrame.h +++ b/stepmania/src/ActorFrame.h @@ -13,6 +13,7 @@ public: virtual ~ActorFrame(); virtual void InitDefaults(); + virtual void InitState(); void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 3ef0ce96c4..b2f6a19960 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -810,7 +810,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus LUA->SetGlobal( "Color1", change.m_def.m_sColor1.empty() ? RString("1,1,1,1") : change.m_def.m_sColor1 ); LUA->SetGlobal( "Color2", change.m_def.m_sColor2.empty() ? RString("1,1,1,1") : change.m_def.m_sColor2 ); - m_pCurrentBGA->InitDefaults(); + m_pCurrentBGA->InitState(); m_pCurrentBGA->PlayCommand( "On" ); m_pCurrentBGA->PlayCommand( "GainFocus" );