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 );
|
||||
void TransferChildren( ActorFrame *pTo );
|
||||
Actor* GetChild( const RString &sName );
|
||||
vector<Actor*> GetChildren() { return m_SubActors; }
|
||||
int GetNumChildren() const { return m_SubActors.size(); }
|
||||
|
||||
void RemoveAllChildren();
|
||||
|
||||
@@ -78,11 +78,18 @@ void ScreenWithMenuElements::Init()
|
||||
|
||||
/* Experimental: Load "decorations" and make them children of the screen. */
|
||||
{
|
||||
AutoActor decorations;
|
||||
decorations.LoadB( m_sName, "decorations" );
|
||||
ActorFrame *pFrame = dynamic_cast<ActorFrame*>((Actor*)decorations);
|
||||
m_Decorations.LoadB( m_sName, "decorations" );
|
||||
ActorFrame *pFrame = dynamic_cast<ActorFrame*>(static_cast<Actor*>(m_Decorations));
|
||||
vector<Actor*> children = pFrame->GetChildren();
|
||||
if( pFrame )
|
||||
pFrame->TransferChildren( this );
|
||||
{
|
||||
FOREACH( Actor*, children, child )
|
||||
this->AddChild( *child );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Decorations.Unload();
|
||||
}
|
||||
}
|
||||
|
||||
m_In.SetName( "In" );
|
||||
|
||||
@@ -43,6 +43,7 @@ protected:
|
||||
MemoryCardDisplay *m_MemoryCardDisplay[NUM_PLAYERS];
|
||||
MenuTimer *m_MenuTimer;
|
||||
AutoActor m_sprOverlay;
|
||||
AutoActor m_Decorations;
|
||||
|
||||
Transition m_In;
|
||||
Transition m_Out;
|
||||
|
||||
Reference in New Issue
Block a user