Skip to content
Browse files

DisplayObjectContainer and as::sprite now have a typedeffed childlist…

…, so the data structure can be changed if needed
  • Loading branch information...
1 parent c39bee4 commit d6880bfc75628da74bf2b5fcc77e749a7549fda7 @gummikana committed Mar 28, 2012
View
2 source/game_utils/actionscript/displayobjectcontainer.cpp
@@ -65,7 +65,7 @@ void DisplayObjectContainer::addChildAt( DisplayObjectContainer* child, int inde
mChildren.push_back( child );
}
-std::list< DisplayObjectContainer* >& DisplayObjectContainer::GetRawChildren(){
+DisplayObjectContainer::ChildList& DisplayObjectContainer::GetRawChildren(){
return mChildren;
}
View
1 source/game_utils/actionscript/displayobjectcontainer.h
@@ -23,6 +23,7 @@
#define INC_DISPLAYOBJECTCONTAINER_H
#include <list>
+#include <vector>
#include <algorithm>
#include "../../utils/debug.h"
View
8 source/game_utils/actionscript/sprite.cpp
@@ -176,8 +176,8 @@ Sprite* Sprite::GetChildByName( const std::string& name )
void Sprite::Clear()
{
- std::list< DisplayObjectContainer* > erase_me = mChildren;
- for( std::list< DisplayObjectContainer* >::iterator i = erase_me.begin(); i != erase_me.end(); ++i )
+ DisplayObjectContainer::ChildList erase_me = mChildren;
+ for( DisplayObjectContainer::ChildList::iterator i = erase_me.begin(); i != erase_me.end(); ++i )
delete *i;
@@ -309,7 +309,7 @@ bool Sprite::DrawChildren( poro::IGraphics* graphics, types::camera* camera, Tra
transform.PushXForm( mXForm, mColor );
- std::list< DisplayObjectContainer* >::iterator i;
+ DisplayObjectContainer::ChildList::iterator i;
Sprite* current = NULL;
for( i = mChildren.begin(); i != mChildren.end(); )
@@ -328,7 +328,7 @@ bool Sprite::DrawChildren( poro::IGraphics* graphics, types::camera* camera, Tra
}
else
{
- std::list< DisplayObjectContainer* >::iterator remove = i;
+ DisplayObjectContainer::ChildList::iterator remove = i;
++i;
mChildren.erase( remove );
// current->SetFather( NULL );

0 comments on commit d6880bf

Please sign in to comment.
Something went wrong with that request. Please try again.