aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChien Yang <[email protected]>2005-01-25 02:48:56 +0000
committerChien Yang <[email protected]>2005-01-25 02:48:56 +0000
commit54321c6d39e6cef2ecffa72e3aa54a0820af6c96 (patch)
tree03a2f42976a5a837e77ba9f7dca4271aedd4b8e9 /src
parent36075f8b7e3db88e0d8013cf341beb085569e7d4 (diff)
Fixed issue 94 : glCallList error.
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@109 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/javax/media/j3d/RenderBin.java34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/classes/share/javax/media/j3d/RenderBin.java b/src/classes/share/javax/media/j3d/RenderBin.java
index 7f69f0a..49f736c 100644
--- a/src/classes/share/javax/media/j3d/RenderBin.java
+++ b/src/classes/share/javax/media/j3d/RenderBin.java
@@ -319,8 +319,8 @@ class RenderBin extends J3dStructure implements ObjectUpdate {
Vector3d localeTranslation = new Vector3d();
// Separate dlists that were added/removed in this snapshot
- UnorderList addDlist = new UnorderList(5, RenderAtomListInfo.class);
- UnorderList removeDlist = new UnorderList(5, RenderAtomListInfo.class);
+ private HashSet addDlist = new HashSet();
+ private HashSet removeDlist = new HashSet();
// Separate dlists per rinfo that were added/removed in this snapshot
ArrayList addDlistPerRinfo = new ArrayList(5);
@@ -863,6 +863,18 @@ class RenderBin extends J3dStructure implements ObjectUpdate {
}
}
+ // Remove entries that are found on both the add and remove lists
+ if (addDlist.size() > 0 && removeDlist.size() > 0) {
+ RenderAtomListInfo arr[] = new RenderAtomListInfo[addDlist.size()];
+ arr = (RenderAtomListInfo []) addDlist.toArray(arr);
+ for (i = 0; i < arr.length; i++) {
+ if (removeDlist.contains(arr[i])) {
+ addDlist.remove(arr[i]);
+ removeDlist.remove(arr[i]);
+ }
+ }
+ }
+
if (addDlist.size() > 0 || removeDlist.size() > 0) {
Canvas3D canvasList[][] = view.getCanvasList(false);
Canvas3D cv;
@@ -963,7 +975,8 @@ class RenderBin extends J3dStructure implements ObjectUpdate {
}
if ((size = addDlist.size()) > 0) {
- arr = (RenderAtomListInfo []) addDlist.toArray(false);
+ arr = new RenderAtomListInfo[size];
+ arr = (RenderAtomListInfo []) addDlist.toArray(arr);
for (i = 0; i < size; i++) {
ra = arr[i];
GeometryArrayRetained geo = (GeometryArrayRetained)ra.geometry();
@@ -984,7 +997,8 @@ class RenderBin extends J3dStructure implements ObjectUpdate {
}
if ((size = removeDlist.size()) > 0) {
- arr = (RenderAtomListInfo []) removeDlist.toArray(false);
+ arr = new RenderAtomListInfo[size];
+ arr = (RenderAtomListInfo []) removeDlist.toArray(arr);
for (i = 0; i < size; i++) {
ra = arr[i];
sharedDList.remove(ra);
@@ -1026,7 +1040,8 @@ class RenderBin extends J3dStructure implements ObjectUpdate {
// Add the newly added dlist to the sharedList
if ((size = addDlist.size()) > 0) {
- arr = (RenderAtomListInfo []) addDlist.toArray(false);
+ arr = new RenderAtomListInfo[size];
+ arr = (RenderAtomListInfo []) addDlist.toArray(arr);
for (i = 0; i <size; i++) {
sharedDList.add(arr[i]);
// Fix for Issue 5: add the render atom to the list of users
@@ -1038,7 +1053,8 @@ class RenderBin extends J3dStructure implements ObjectUpdate {
// Remove the newly removed dlist from the sharedList
if ((size = removeDlist.size()) > 0) {
- arr = (RenderAtomListInfo []) removeDlist.toArray(false);
+ arr = new RenderAtomListInfo[size];
+ arr = (RenderAtomListInfo []) removeDlist.toArray(arr);
for (i = 0; i < size; i++) {
sharedDList.remove(arr[i]);
// Fix for Issue 5: remove this render atom from the list of users
@@ -1053,7 +1069,8 @@ class RenderBin extends J3dStructure implements ObjectUpdate {
cv = canvases[j];
if ((size = addDlist.size()) > 0) {
- arr = (RenderAtomListInfo []) addDlist.toArray(false);
+ arr = new RenderAtomListInfo[size];
+ arr = (RenderAtomListInfo []) addDlist.toArray(arr);
for (i = 0; i <size; i++) {
ra = arr[i];
GeometryArrayRetained geo = (GeometryArrayRetained) ra.geometry();
@@ -1068,7 +1085,8 @@ class RenderBin extends J3dStructure implements ObjectUpdate {
}
}
if ((size = removeDlist.size()) > 0) {
- arr = (RenderAtomListInfo []) removeDlist.toArray(false);
+ arr = new RenderAtomListInfo[size];
+ arr = (RenderAtomListInfo []) removeDlist.toArray(arr);
for (i = 0; i < size; i++) {
GeometryArrayRetained geo =
(GeometryArrayRetained) arr[i].geometry();