|
From: <cn...@us...> - 2009-08-11 03:09:02
|
Revision: 473
http://hgengine.svn.sourceforge.net/hgengine/?rev=473&view=rev
Author: cnlohr
Date: 2009-08-11 03:08:53 +0000 (Tue, 11 Aug 2009)
Log Message:
-----------
free up some some protection (temporarily with note) and fix traversal code
Modified Paths:
--------------
Mercury2/src/MercuryNode.cpp
Mercury2/src/MercuryNode.h
Modified: Mercury2/src/MercuryNode.cpp
===================================================================
--- Mercury2/src/MercuryNode.cpp 2009-08-11 03:06:51 UTC (rev 472)
+++ Mercury2/src/MercuryNode.cpp 2009-08-11 03:08:53 UTC (rev 473)
@@ -128,18 +128,25 @@
return ret;
}
-MercuryNode * MercuryNode::TraversalNextNode( MercuryNode * stopnode )
+MercuryNode * MercuryNode::TraversalNextNode( MercuryNode * stopnode, int & iDepthDelta )
{
if( !m_children.empty() )
+ {
+ iDepthDelta++;
return *(m_children.begin());
+ }
else if( m_nextSibling )
return m_nextSibling;
else if( m_parent )
{
MercuryNode * ret = m_parent;
+ iDepthDelta--;
while( ret && ret != stopnode && !ret->m_nextSibling )
+ {
+ iDepthDelta--;
ret = ret->m_parent;
+ }
if( !ret || ret == stopnode )
return 0;
Modified: Mercury2/src/MercuryNode.h
===================================================================
--- Mercury2/src/MercuryNode.h 2009-08-11 03:06:51 UTC (rev 472)
+++ Mercury2/src/MercuryNode.h 2009-08-11 03:08:53 UTC (rev 473)
@@ -55,7 +55,7 @@
///Get the next node in an in-order traversal
/** In the traversal, stopnode indicates the node that when passing
by on returning up the tree haults traversal. */
- MercuryNode * TraversalNextNode( MercuryNode * stopnode );
+ MercuryNode * TraversalNextNode( MercuryNode * stopnode, int & iDepthDelta );
virtual void Update(float dTime) {};
virtual void RecursiveUpdate(float dTime);
@@ -121,7 +121,7 @@
bool m_hidden;
bool m_useAlphaPath;
bool m_culled;
- private:
+ public: //XXX: This will become private sooner or later... It is temporarily public for other work.
bool IsInAssetList(MercuryAsset* asset) const;
OcclusionResult m_occlusionResult;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|