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:
@@ -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();
|
||||||
|
|||||||
@@ -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" );
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user