From 8953786b8fc3548c37ee57cb788c0e8673fe1d84 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 12 Feb 2007 00:02:58 +0000 Subject: [PATCH] simpler, more flexible loading Def.MeterDisplay { Stream = LoadActor("..."); }; --- stepmania/src/MeterDisplay.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/stepmania/src/MeterDisplay.cpp b/stepmania/src/MeterDisplay.cpp index 9fe7c75e7a..99063cede1 100644 --- a/stepmania/src/MeterDisplay.cpp +++ b/stepmania/src/MeterDisplay.cpp @@ -36,15 +36,12 @@ void MeterDisplay::LoadFromNode( const XNode* pNode ) if( !pNode->GetAttrValue("StreamWidth", m_fStreamWidth) ) RageException::Throw( "%s: MeterDisplay: missing the \"StreamWidth\" attribute", ActorUtil::GetWhere(pNode).c_str() ); - { - RString sStreamPath; - if( !ActorUtil::GetAttrPath(pNode, "StreamPath", sStreamPath) ) - RageException::Throw( "%s: MeterDisplay: missing the \"StreamPath\" attribute", ActorUtil::GetWhere(pNode).c_str() ); - - m_sprStream.Load( sStreamPath ); - m_sprStream->SetZoomX( m_fStreamWidth / m_sprStream->GetUnzoomedWidth() ); - this->AddChild( m_sprStream ); - } + const XNode *pStream = pNode->GetChild( "Stream" ); + if( pStream == NULL ) + RageException::Throw( "%s: MeterDisplay: missing the \"Stream\" attribute", ActorUtil::GetWhere(pNode).c_str() ); + m_sprStream.LoadActorFromNode( pStream, this ); + m_sprStream->SetZoomX( m_fStreamWidth / m_sprStream->GetUnzoomedWidth() ); + this->AddChild( m_sprStream ); const XNode* pChild = pNode->GetChild( "Tip" ); if( pChild != NULL )