use standard load path, not ActorUtil::LoadFromActorFile directly
This commit is contained in:
@@ -12,41 +12,34 @@ REGISTER_ACTOR_CLASS( ComboGraph )
|
|||||||
|
|
||||||
ComboGraph::ComboGraph()
|
ComboGraph::ComboGraph()
|
||||||
{
|
{
|
||||||
|
DeleteChildrenWhenDone( true );
|
||||||
|
|
||||||
m_pNormalCombo = NULL;
|
m_pNormalCombo = NULL;
|
||||||
m_pMaxCombo = NULL;
|
m_pMaxCombo = NULL;
|
||||||
}
|
m_pMaxComboText = NULL;
|
||||||
|
|
||||||
ComboGraph::~ComboGraph()
|
|
||||||
{
|
|
||||||
delete m_pNormalCombo;
|
|
||||||
delete m_pMaxCombo;
|
|
||||||
this->DeleteAllChildren();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboGraph::LoadFromNode( const CString& sDir, const XNode* pNode )
|
void ComboGraph::LoadFromNode( const CString& sDir, const XNode* pNode )
|
||||||
{
|
{
|
||||||
ActorFrame::LoadFromNode( sDir, pNode );
|
ActorFrame::LoadFromNode( sDir, pNode );
|
||||||
|
|
||||||
const XNode *pChild = pNode->GetChild( "MaxComboText" );
|
m_pMaxComboText = (BitmapText *) this->GetChild( "MaxComboText" );
|
||||||
if( pChild == NULL )
|
if( m_pMaxComboText == NULL )
|
||||||
RageException::Throw( ssprintf("ComboGraph in \"%s\" is missing the node \"MaxComboText\"", sDir.c_str()) );
|
RageException::Throw( ssprintf("ComboGraph in \"%s\" must have a child named \"MaxComboText\"", sDir.c_str()) );
|
||||||
m_MaxComboText.LoadFromNode( sDir, pChild );
|
if( !m_pMaxComboText->IsType("BitmapText") )
|
||||||
|
RageException::Throw( ssprintf("ComboGraph in \"%s\" has a child named \"MaxComboText\" that is not a BitmapText", sDir.c_str()) );
|
||||||
|
|
||||||
pChild = pNode->GetChild( "NormalCombo" );
|
m_pNormalCombo = this->GetChild( "NormalCombo" );
|
||||||
if( pChild == NULL )
|
if( m_pNormalCombo == NULL )
|
||||||
RageException::Throw( ssprintf("ComboGraph in \"%s\" is missing the node \"NormalCombo\"", sDir.c_str()) );
|
RageException::Throw( ssprintf("ComboGraph in \"%s\" must have a child named \"NormalCombo\"", sDir.c_str()) );
|
||||||
m_pNormalCombo = ActorUtil::LoadFromActorFile( sDir, pChild );
|
|
||||||
|
|
||||||
pChild = pNode->GetChild( "MaxCombo" );
|
m_pMaxCombo = this->GetChild( "MaxCombo" );
|
||||||
if( pChild == NULL )
|
if( m_pMaxCombo == NULL )
|
||||||
RageException::Throw( ssprintf("ComboGraph in \"%s\" is missing the node \"MaxCombo\"", sDir.c_str()) );
|
RageException::Throw( ssprintf("ComboGraph in \"%s\" must have a child named \"MaxCombo\"", sDir.c_str()) );
|
||||||
m_pMaxCombo = ActorUtil::LoadFromActorFile( sDir, pChild );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboGraph::Load( const StageStats &s, const PlayerStageStats &pss )
|
void ComboGraph::Load( const StageStats &s, const PlayerStageStats &pss )
|
||||||
{
|
{
|
||||||
ASSERT( m_SubActors.size() == 0 );
|
|
||||||
|
|
||||||
const float fFirstSecond = 0;
|
const float fFirstSecond = 0;
|
||||||
const float fLastSecond = s.GetTotalPossibleStepsSeconds();
|
const float fLastSecond = s.GetTotalPossibleStepsSeconds();
|
||||||
|
|
||||||
@@ -90,7 +83,7 @@ void ComboGraph::Load( const StageStats &s, const PlayerStageStats &pss )
|
|||||||
if( !bIsMax )
|
if( !bIsMax )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
BitmapText *pText = (BitmapText *) m_MaxComboText.Copy(); // XXX Copy should be covariant
|
BitmapText *pText = (BitmapText *) m_pMaxComboText->Copy(); // XXX Copy should be covariant
|
||||||
|
|
||||||
const float fStart = SCALE( combo.fStartSecond, fFirstSecond, fLastSecond, 0.0f, 1.0f );
|
const float fStart = SCALE( combo.fStartSecond, fFirstSecond, fLastSecond, 0.0f, 1.0f );
|
||||||
const float fSize = SCALE( combo.fSizeSeconds, 0, fLastSecond-fFirstSecond, 0.0f, 1.0f );
|
const float fSize = SCALE( combo.fSizeSeconds, 0, fLastSecond-fFirstSecond, 0.0f, 1.0f );
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ class ComboGraph: public ActorFrame
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ComboGraph();
|
ComboGraph();
|
||||||
~ComboGraph();
|
|
||||||
void Load( const StageStats &s, const PlayerStageStats &pss );
|
void Load( const StageStats &s, const PlayerStageStats &pss );
|
||||||
virtual void LoadFromNode( const CString& sDir, const XNode* pNode );
|
virtual void LoadFromNode( const CString& sDir, const XNode* pNode );
|
||||||
virtual Actor *Copy() const;
|
virtual Actor *Copy() const;
|
||||||
|
virtual bool AutoLoadChildren() const { return true; }
|
||||||
|
|
||||||
//
|
//
|
||||||
// Commands
|
// Commands
|
||||||
@@ -24,7 +24,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
Actor *m_pNormalCombo;
|
Actor *m_pNormalCombo;
|
||||||
Actor *m_pMaxCombo;
|
Actor *m_pMaxCombo;
|
||||||
BitmapText m_MaxComboText;
|
BitmapText *m_pMaxComboText;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user