Hack to get the decorations to be deleted. Fixes crashes, but probably not the best way to go about this.

This commit is contained in:
Steve Checkoway
2009-10-26 03:05:08 +00:00
parent adbce38f13
commit 1f81a20838
3 changed files with 13 additions and 4 deletions
+1
View File
@@ -20,6 +20,7 @@ public:
virtual void RemoveChild( Actor *pActor ); virtual void RemoveChild( Actor *pActor );
void TransferChildren( ActorFrame *pTo ); void TransferChildren( ActorFrame *pTo );
Actor* GetChild( const RString &sName ); Actor* GetChild( const RString &sName );
vector<Actor*> GetChildren() { return m_SubActors; }
int GetNumChildren() const { return m_SubActors.size(); } int GetNumChildren() const { return m_SubActors.size(); }
void RemoveAllChildren(); void RemoveAllChildren();
+11 -4
View File
@@ -78,11 +78,18 @@ void ScreenWithMenuElements::Init()
/* Experimental: Load "decorations" and make them children of the screen. */ /* Experimental: Load "decorations" and make them children of the screen. */
{ {
AutoActor decorations; m_Decorations.LoadB( m_sName, "decorations" );
decorations.LoadB( m_sName, "decorations" ); ActorFrame *pFrame = dynamic_cast<ActorFrame*>(static_cast<Actor*>(m_Decorations));
ActorFrame *pFrame = dynamic_cast<ActorFrame*>((Actor*)decorations); vector<Actor*> children = pFrame->GetChildren();
if( pFrame ) if( pFrame )
pFrame->TransferChildren( this ); {
FOREACH( Actor*, children, child )
this->AddChild( *child );
}
else
{
m_Decorations.Unload();
}
} }
m_In.SetName( "In" ); m_In.SetName( "In" );
+1
View File
@@ -43,6 +43,7 @@ protected:
MemoryCardDisplay *m_MemoryCardDisplay[NUM_PLAYERS]; MemoryCardDisplay *m_MemoryCardDisplay[NUM_PLAYERS];
MenuTimer *m_MenuTimer; MenuTimer *m_MenuTimer;
AutoActor m_sprOverlay; AutoActor m_sprOverlay;
AutoActor m_Decorations;
Transition m_In; Transition m_In;
Transition m_Out; Transition m_Out;