diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 69c43bc7ac..873d7f45c1 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -261,7 +261,7 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode ) else if( sKeyName == "BaseZoomZ" ) SetBaseZoomZ( StringToFloat(sValue) ); else if( EndsWith(sKeyName,"Command") ) { - apActorCommands apac = ActorCommands( sValue ); + apActorCommands apac = ActorUtil::ParseActorCommands( sValue ); RString sCmdName = sKeyName.Left( sKeyName.size()-7 ); AddCommand( sCmdName, apac ); diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 89307fe2e3..21a6b3b78c 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -394,6 +394,11 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, const XNode *pParent, Actor } } +apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands ) +{ + return ActorCommands( sCommands ); +} + void ActorUtil::SetXY( Actor& actor, const RString &sType ) { ASSERT( !actor.GetName().empty() ); diff --git a/stepmania/src/ActorUtil.h b/stepmania/src/ActorUtil.h index 7800f0bf05..b55ff53f67 100644 --- a/stepmania/src/ActorUtil.h +++ b/stepmania/src/ActorUtil.h @@ -5,6 +5,7 @@ #include "Actor.h" #include "RageTexture.h" +#include "ActorCommands.h" class XNode; @@ -45,7 +46,7 @@ namespace ActorUtil void Register( const RString& sClassName, CreateActorFn pfn ); Actor* Create( const RString& sClassName, const RString& sDir, const XNode* pNode, Actor *pParentActor ); - + apActorCommands ParseActorCommands( const RString &sCommands ); void SetXY( Actor& actor, const RString &sType ); void LoadCommand( Actor& actor, const RString &sType, const RString &sCommandName ); void LoadCommandFromName( Actor& actor, const RString &sType, const RString &sCommandName, const RString &sName ); diff --git a/stepmania/src/BGAnimation.cpp b/stepmania/src/BGAnimation.cpp index 0c6cc3e916..d28d178ae5 100644 --- a/stepmania/src/BGAnimation.cpp +++ b/stepmania/src/BGAnimation.cpp @@ -158,7 +158,7 @@ void BGAnimation::LoadFromNode( const RString& sDir, const XNode* pNode ) Actor *pActor = new Actor; pActor->SetName( "BGAnimation dummy" ); pActor->SetHidden( true ); - apActorCommands ap = ActorCommands( ssprintf("sleep,%f",fLengthSeconds) ); + apActorCommands ap = ActorUtil::ParseActorCommands( ssprintf("sleep,%f",fLengthSeconds) ); pActor->AddCommand( "On", ap ); AddChild( pActor ); } diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index cd78f180f8..27cd0d406c 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -187,12 +187,12 @@ void BackgroundImpl::Init() RString sCmdLeaves; bool bSuccess = xml.GetAttrValue( "LeavesCommand", sCmdLeaves ); ASSERT( bSuccess ); - bgt.cmdLeaves = ActorCommands( sCmdLeaves ); + bgt.cmdLeaves = ActorUtil::ParseActorCommands( sCmdLeaves ); RString sCmdRoot; bSuccess = xml.GetAttrValue( "RootCommand", sCmdRoot ); ASSERT( bSuccess ); - bgt.cmdRoot = ActorCommands( sCmdRoot ); + bgt.cmdRoot = ActorUtil::ParseActorCommands( sCmdRoot ); } } @@ -715,7 +715,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) * may look something like "BGAnimation, BGAnimationLayer, Sprite" or it * may be deeper, like "BGAnimation, BGAnimationLayer, BGAnimation, * BGAnimationLayer, Sprite". */ - pBGA->RunCommands( ActorCommands("effectclock,music") ); + pBGA->RunCommands( ActorUtil::ParseActorCommands("effectclock,music") ); } } diff --git a/stepmania/src/NoteSkinManager.cpp b/stepmania/src/NoteSkinManager.cpp index 6bc24ee065..36c4dfd52f 100644 --- a/stepmania/src/NoteSkinManager.cpp +++ b/stepmania/src/NoteSkinManager.cpp @@ -194,7 +194,7 @@ bool NoteSkinManager::GetMetricB( const RString &sButtonName, const RString &sVa apActorCommands NoteSkinManager::GetMetricA( const RString &sButtonName, const RString &sValueName ) { - return ActorCommands( GetMetric(sButtonName,sValueName) ); + return ActorUtil::ParseActorCommands( GetMetric(sButtonName,sValueName) ); } RString NoteSkinManager::GetPath( const RString &sButtonName, const RString &sElement ) diff --git a/stepmania/src/NoteSkinManager.h b/stepmania/src/NoteSkinManager.h index e522cd0b5d..fad91ea19c 100644 --- a/stepmania/src/NoteSkinManager.h +++ b/stepmania/src/NoteSkinManager.h @@ -4,6 +4,7 @@ #define NOTE_SKIN_MANAGER_H #include "ActorCommands.h" +#include "ActorUtil.h" #include "RageTypes.h" #include "PlayerNumber.h" #include "IniFile.h" diff --git a/stepmania/src/ScoreDisplayBattle.cpp b/stepmania/src/ScoreDisplayBattle.cpp index 0281bfa729..f3903e56b8 100644 --- a/stepmania/src/ScoreDisplayBattle.cpp +++ b/stepmania/src/ScoreDisplayBattle.cpp @@ -6,6 +6,7 @@ #include "GameState.h" #include "ThemeManager.h" #include "PlayerState.h" +#include "ActorUtil.h" #define ITEM_X( i ) THEME->GetMetricF("ScoreDisplayBattle",ssprintf("Item%dX",i+1)) #define ITEM_Y( i ) THEME->GetMetricF("ScoreDisplayBattle",ssprintf("Item%dY",i+1)) @@ -50,14 +51,14 @@ void ScoreDisplayBattle::Update( float fDelta ) if( sNewModifier == "" ) { - m_ItemIcon[s].RunCommands( ActorCommands( "linear,0.25;zoom,0" ) ); + m_ItemIcon[s].RunCommands( ActorUtil::ParseActorCommands( "linear,0.25;zoom,0" ) ); } else { // TODO: Cache all of the icon graphics so we don't load them dynamically from disk. m_ItemIcon[s].Load( THEME->GetPathG("ScoreDisplayBattle","icon "+sNewModifier) ); m_ItemIcon[s].StopTweening(); - apActorCommands acmds = ActorCommands( + apActorCommands acmds = ActorUtil::ParseActorCommands( "diffuse,1,1,1,1;zoom,1;" "sleep,0.1;linear,0;diffusealpha,0;" "sleep,0.1;linear,0;diffusealpha,1;" diff --git a/stepmania/src/ScreenEnding.cpp b/stepmania/src/ScreenEnding.cpp index 669d31ca07..6d83f8fb07 100644 --- a/stepmania/src/ScreenEnding.cpp +++ b/stepmania/src/ScreenEnding.cpp @@ -103,7 +103,7 @@ void ScreenEnding::Init() break; } SET_XY_AND_ON_COMMAND( m_sprRemoveMemoryCard[p] ); - m_sprRemoveMemoryCard[p].AddCommand( ssprintf("CardRemovedP%dMessage",p+1), ActorCommands("hidden,1") ); + m_sprRemoveMemoryCard[p].AddCommand( ssprintf("CardRemovedP%dMessage",p+1), ActorUtil::ParseActorCommands("hidden,1") ); this->AddChild( &m_sprRemoveMemoryCard[p] ); } diff --git a/stepmania/src/ScreenEz2SelectMusic.cpp b/stepmania/src/ScreenEz2SelectMusic.cpp index d50eb7f43b..99bca3eefd 100644 --- a/stepmania/src/ScreenEz2SelectMusic.cpp +++ b/stepmania/src/ScreenEz2SelectMusic.cpp @@ -410,10 +410,10 @@ void ScreenEz2SelectMusic::MenuBack( const InputEventPlus &input ) void ScreenEz2SelectMusic::TweenOffScreen() { - apActorCommands cmds = ActorCommands( "linear,0.5;zoomy,0" ); + apActorCommands cmds = ActorUtil::ParseActorCommands( "linear,0.5;zoomy,0" ); m_MusicBannerWheel.RunCommands( cmds ); - apActorCommands cmds2 = ActorCommands( "Linear,1;DiffuseAlpha,0" ); + apActorCommands cmds2 = ActorUtil::ParseActorCommands( "Linear,1;DiffuseAlpha,0" ); m_PumpDifficultyCircle.RunCommands( cmds2 ); m_Guide.RunCommands( cmds2 ); m_PumpDifficultyRating.RunCommands( cmds2 ); diff --git a/stepmania/src/ScreenUnlockStatus.cpp b/stepmania/src/ScreenUnlockStatus.cpp index 370d4f969a..e4f5cea731 100644 --- a/stepmania/src/ScreenUnlockStatus.cpp +++ b/stepmania/src/ScreenUnlockStatus.cpp @@ -157,12 +157,12 @@ void ScreenUnlockStatus::Init() //LOG->Trace("Target Row: %f", TargetRow); //LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() ); RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY); - text->RunCommands( ActorCommands(sCommand) ); + text->RunCommands( ActorUtil::ParseActorCommands(sCommand) ); } else { RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY); - text->RunCommands( ActorCommands(sCommand) ); + text->RunCommands( ActorUtil::ParseActorCommands(sCommand) ); } item.push_back(text); @@ -189,12 +189,12 @@ void ScreenUnlockStatus::Init() //LOG->Trace("Target Row: %f", TargetRow); //LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() ); RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY); - IconCount->RunCommands( ActorCommands(sCommand) ); + IconCount->RunCommands( ActorUtil::ParseActorCommands(sCommand) ); } else { RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY); - IconCount->RunCommands( ActorCommands(sCommand) ); + IconCount->RunCommands( ActorUtil::ParseActorCommands(sCommand) ); } ItemIcons.push_back(IconCount); @@ -252,7 +252,7 @@ void ScreenUnlockStatus::Init() NewText->SetXY(ScrollingTextX, ScrollingTextStartY); { RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows )); - NewText->RunCommands( ActorCommands(sCommand) ); + NewText->RunCommands( ActorUtil::ParseActorCommands(sCommand) ); } // new unlock graphic @@ -263,7 +263,7 @@ void ScreenUnlockStatus::Init() NewIcon->SetWidth(UNLOCK_TEXT_SCROLL_ICON_SIZE); { RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows )); - NewIcon->RunCommands( ActorCommands(sCommand) ); + NewIcon->RunCommands( ActorUtil::ParseActorCommands(sCommand) ); } ItemIcons.push_back(NewIcon); diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 99db560186..b61135af1e 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -23,6 +23,7 @@ #include "SpecialFiles.h" #include "EnumHelper.h" #include "PrefsManager.h" +#include "ActorUtil.h" ThemeManager* THEME = NULL; // global object accessable from anywhere in the program @@ -945,7 +946,7 @@ RageColor ThemeManager::GetMetricC( const RString &sClassName, const RString &sV apActorCommands ThemeManager::GetMetricA( const RString &sClassName, const RString &sValueName ) { RString sValue = GetMetricRaw( g_pLoadedThemeData->iniMetrics, sClassName, sValueName ); - return ActorCommands( sValue ); + return ActorUtil::ParseActorCommands( sValue ); } #endif