Permalink
Browse files

[DisplayObjectContainer] Improved display list debug output

Show the whole display list recursively (starting from a given
object). Show position and size, visibility, alpha and address.
  • Loading branch information...
1 parent 95a4ca3 commit 419f3a92bec4dac2ceda69d66d2b42498d8289f7 @aajanki aajanki committed Feb 27, 2013
@@ -99,7 +99,6 @@ friend std::ostream& operator<<(std::ostream& s, const DisplayObject& r);
number_t computeWidth();
number_t computeHeight();
bool skipRender() const;
- float clippedAlpha() const;
void defaultRender(RenderContext& ctxt) const;
virtual bool boundsRect(number_t& xmin, number_t& xmax, number_t& ymin, number_t& ymax) const
@@ -160,6 +159,8 @@ friend std::ostream& operator<<(std::ostream& s, const DisplayObject& r);
virtual void setOnStage(bool staged);
bool isOnStage() const { return onStage; }
bool isMask() const { return !maskOf.isNull(); }
+ bool isVisible() const { return visible; };
+ float clippedAlpha() const;
virtual _NR<RootMovieClip> getRoot();
virtual _NR<Stage> getStage();
void setLegacyMatrix(const MATRIX& m);
@@ -1515,12 +1515,26 @@ ASFUNCTIONBODY_GETTER_SETTER(InteractiveObject, contextMenu);
ASFUNCTIONBODY_GETTER_SETTER(InteractiveObject, tabEnabled);
ASFUNCTIONBODY_GETTER_SETTER(InteractiveObject, tabIndex);
-void DisplayObjectContainer::dumpDisplayList()
+void DisplayObjectContainer::dumpDisplayList(unsigned int level)
{
- LOG(LOG_INFO, "Size: " << dynamicDisplayList.size());
+ tiny_string indent(std::string(2*level, ' '));
list<_R<DisplayObject> >::const_iterator it=dynamicDisplayList.begin();
for(;it!=dynamicDisplayList.end();++it)
- LOG(LOG_INFO, (*it)->getClass()->class_name);
+ {
+ Vector2f pos = (*it)->getXY();
+ LOG(LOG_INFO, indent << (*it)->getClass()->class_name <<
+ " (" << pos.x << "," << pos.y << ") " <<
+ (*it)->getNominalWidth() << "x" << (*it)->getNominalHeight() << " " <<
+ ((*it)->isVisible() ? "v" : "") <<
+ ((*it)->isMask() ? "m" : "") << " " <<
+ "a=" << (*it)->clippedAlpha() << " " <<
+ it->getPtr());
+
+ if ((*it)->is<DisplayObjectContainer>())
+ {
+ (*it)->as<DisplayObjectContainer>()->dumpDisplayList(level+1);
+ }
+ }
}
void DisplayObjectContainer::setOnStage(bool staged)
@@ -93,7 +93,7 @@ class DisplayObjectContainer: public InteractiveObject
void renderImpl(RenderContext& ctxt) const;
public:
void _addChildAt(_R<DisplayObject> child, unsigned int index);
- void dumpDisplayList();
+ void dumpDisplayList(unsigned int level=0);
bool _removeChild(_R<DisplayObject> child);
int getChildIndex(_R<DisplayObject> child);
DisplayObjectContainer(Class_base* c);

0 comments on commit 419f3a9

Please sign in to comment.