[Nasa-exp-checkins] SF.net SVN: nasa-exp: [4026] trunk/WorldWind/PluginSDK
Brought to you by:
baker99-bull,
vigilant
From: <nig...@us...> - 2008-07-12 08:44:33
|
Revision: 4026 http://nasa-exp.svn.sourceforge.net/nasa-exp/?rev=4026&view=rev Author: nigel_ht Date: 2008-07-12 01:44:42 -0700 (Sat, 12 Jul 2008) Log Message: ----------- WW-884 Icons should now render children at right priority Modified Paths: -------------- trunk/WorldWind/PluginSDK/Icons.cs trunk/WorldWind/PluginSDK/RenderableObjectList.cs Modified: trunk/WorldWind/PluginSDK/Icons.cs =================================================================== --- trunk/WorldWind/PluginSDK/Icons.cs 2008-07-11 11:58:01 UTC (rev 4025) +++ trunk/WorldWind/PluginSDK/Icons.cs 2008-07-12 08:44:42 UTC (rev 4026) @@ -332,8 +332,6 @@ public override void Render(DrawArgs drawArgs) { - // if we dont know the current render priority then just use our own - RenderChildren(drawArgs, this.RenderPriority); } /// <summary> @@ -355,6 +353,9 @@ if (!isInitialized) return; + // render ourselves + this.Render(drawArgs); + if (m_canUsePointSprites) pointSprites.Clear(); Modified: trunk/WorldWind/PluginSDK/RenderableObjectList.cs =================================================================== --- trunk/WorldWind/PluginSDK/RenderableObjectList.cs 2008-07-11 11:58:01 UTC (rev 4025) +++ trunk/WorldWind/PluginSDK/RenderableObjectList.cs 2008-07-12 08:44:42 UTC (rev 4026) @@ -460,7 +460,7 @@ { if (ro.IsOn) { - if ((ro is RenderableObjectList) && !(ro is Icons)) + if ((ro is RenderableObjectList) )//&& !(ro is Icons)) { (ro as RenderableObjectList).RenderChildren(drawArgs, priority); } @@ -550,12 +550,36 @@ } } + public bool GetReaderLock(int retrys) + { + for (int i = 0; i < retrys; i++) + { + try + { + m_childrenRWLock.AcquireWriterLock(5); + return true; + } + catch + { + } + // don't know if this is required + Thread.Sleep(5); + } + return false; + } + + public void ReleaseReaderLock() + { + m_childrenRWLock.ReleaseReaderLock(); + } + + /// <summary> /// Tries to get the writer lock for the children list. Each try takes 10ms /// </summary> /// <param name="retrys">How many times to try</param> /// <returns></returns> - private bool GetWriterLock(int retrys) + public bool GetWriterLock(int retrys) { for (int i = 0; i < retrys; i++) { @@ -573,6 +597,12 @@ return false; } + public void ReleaseWriterLock() + { + m_childrenRWLock.ReleaseWriterLock(); + } + + /// <summary> /// Add a child object to this layer. If the new object has the same name as an existing object in this /// ROL it gets a number appended. If the new object is a ROL and there was already a ROL with the same This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |