diff options
author | Kevin Rushforth <[email protected]> | 2006-10-26 16:39:33 +0000 |
---|---|---|
committer | Kevin Rushforth <[email protected]> | 2006-10-26 16:39:33 +0000 |
commit | 9b7f91292fcf0cbed1e80dfb4ff998b1a7352939 (patch) | |
tree | ef07d9a6a2a57158857f4c89edaa912a73324875 /src | |
parent | 5603761c3ee80f7c4f987e6d9cc95babea833ab3 (diff) |
Fixed issue 312: Exception while detaching ModelClip from ViewSpecificGroup
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@728 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src')
-rw-r--r-- | src/classes/share/javax/media/j3d/GroupRetained.java | 32 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/Locale.java | 30 |
2 files changed, 40 insertions, 22 deletions
diff --git a/src/classes/share/javax/media/j3d/GroupRetained.java b/src/classes/share/javax/media/j3d/GroupRetained.java index e27ff91..ccd9d2f 100644 --- a/src/classes/share/javax/media/j3d/GroupRetained.java +++ b/src/classes/share/javax/media/j3d/GroupRetained.java @@ -1691,6 +1691,15 @@ class GroupRetained extends NodeRetained implements BHLeafInterface { s.altAppearances = altAppearances; s.modelClips = modelClips; + // Issue 312: Allocate data structures if we are in a ViewSpecificGroup + if (s.inViewSpecificGroup && + (s.changedViewGroup == null)) { + s.changedViewGroup = new ArrayList(); + s.changedViewList = new ArrayList(); + s.keyList = new int[10]; + s.viewScopedNodeList = new ArrayList(); + s.scopedNodesViewList = new ArrayList(); + } if (this instanceof OrderedGroupRetained && linkNode == null) { // set this regardless of refCount @@ -1764,15 +1773,10 @@ class GroupRetained extends NodeRetained implements BHLeafInterface { destroyMessage.args[4] = s.ogCIOTableList.toArray(); } - if(sendVSGMessage) { - destroyMessage = messages[messageIndex++]; - destroyMessage.threads = J3dThread.UPDATE_RENDERING_ENVIRONMENT; - destroyMessage.type = J3dMessage.VIEWSPECIFICGROUP_CLEAR; - destroyMessage.universe = universe; - destroyMessage.args[0] = s.changedViewGroup; - destroyMessage.args[1] = s.keyList; - } - + // Issue 312: We need to send the REMOVE_NODES message to the + // RenderingEnvironmentStructure before we send VIEWSPECIFICGROUP_CLEAR, + // since the latter clears the list of views that is referred to by + // scopedNodesViewList and used by removeNodes. destroyMessage = messages[messageIndex++]; destroyMessage.threads = s.notifyThreads; destroyMessage.type = J3dMessage.REMOVE_NODES; @@ -1790,6 +1794,16 @@ class GroupRetained extends NodeRetained implements BHLeafInterface { destroyMessage.args[3] = s.viewScopedNodeList; destroyMessage.args[4] = s.scopedNodesViewList; } + + if(sendVSGMessage) { + destroyMessage = messages[messageIndex++]; + destroyMessage.threads = J3dThread.UPDATE_RENDERING_ENVIRONMENT; + destroyMessage.type = J3dMessage.VIEWSPECIFICGROUP_CLEAR; + destroyMessage.universe = universe; + destroyMessage.args[0] = s.changedViewGroup; + destroyMessage.args[1] = s.keyList; + } + if (sendMessages == true) { VirtualUniverse.mc.processMessage(messages); } diff --git a/src/classes/share/javax/media/j3d/Locale.java b/src/classes/share/javax/media/j3d/Locale.java index 92f9a3b..4b5fb72 100644 --- a/src/classes/share/javax/media/j3d/Locale.java +++ b/src/classes/share/javax/media/j3d/Locale.java @@ -346,25 +346,16 @@ public class Locale extends Object { destroyMessage.args[3] = universe.setLiveState.ogCIOList.toArray(); destroyMessage.args[4] = universe.setLiveState.ogCIOTableList.toArray(); + // Issue 312: We need to send the REMOVE_NODES message to the + // RenderingEnvironmentStructure before we send VIEWSPECIFICGROUP_CLEAR, + // since the latter clears the list of views that is referred to by + // scopedNodesViewList and used by removeNodes. if (messages == null) { VirtualUniverse.mc.processMessage(destroyMessage); destroyMessage = new J3dMessage(); } else { destroyMessage = messages[startIndex++]; } - destroyMessage.threads = J3dThread.UPDATE_RENDERING_ENVIRONMENT; - destroyMessage.type = J3dMessage.VIEWSPECIFICGROUP_CLEAR; - destroyMessage.universe = universe; - destroyMessage.args[0] = universe.setLiveState.changedViewGroup; - destroyMessage.args[1] = universe.setLiveState.keyList; - - if (messages == null) { - VirtualUniverse.mc.processMessage(destroyMessage); - destroyMessage = new J3dMessage(); - } else { - destroyMessage = messages[startIndex++]; - } - destroyMessage.threads = universe.setLiveState.notifyThreads; destroyMessage.type = J3dMessage.REMOVE_NODES; destroyMessage.universe = universe; @@ -373,6 +364,19 @@ public class Locale extends Object { destroyMessage.args[3] = universe.setLiveState.viewScopedNodeList; destroyMessage.args[4] = universe.setLiveState.scopedNodesViewList; } + + if (messages == null) { + VirtualUniverse.mc.processMessage(destroyMessage); + destroyMessage = new J3dMessage(); + } else { + destroyMessage = messages[startIndex++]; + } + destroyMessage.threads = J3dThread.UPDATE_RENDERING_ENVIRONMENT; + destroyMessage.type = J3dMessage.VIEWSPECIFICGROUP_CLEAR; + destroyMessage.universe = universe; + destroyMessage.args[0] = universe.setLiveState.changedViewGroup; + destroyMessage.args[1] = universe.setLiveState.keyList; + if (messages == null) { VirtualUniverse.mc.processMessage(destroyMessage); } else { |