simpler, more flexible loading

Def.MeterDisplay {
    Stream = LoadActor("...");
};
This commit is contained in:
Glenn Maynard
2007-02-12 00:02:58 +00:00
parent fc444c1009
commit 8953786b8f
+6 -9
View File
@@ -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 )