Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17388/src/net/sourceforge/bprocessor/gl/view
Modified Files:
Display.java
Log Message:
refactored draw(Space s... in two to get a draw mechanism for instances and spaces that aint instances
Index: Display.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** Display.java 9 Nov 2007 12:23:29 -0000 1.51
--- Display.java 12 Nov 2007 14:17:05 -0000 1.52
***************
*** 823,851 ****
private static void draw(Space space, boolean inside) {
if (space.isInstance()) {
! translateToCoordinatesystem(space);
}
! if (space.isLocked() && USEDL) {
if (selecting) {
! Integer index = displayListsSelecting.get(space);
if (index != null) {
gl.glCallList(index);
return;
} else {
index = gl.glGenLists(1);
! displayListsSelecting.put(space, index);
gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE);
}
} else {
! Integer index = displayLists.get(space);
if (index != null) {
gl.glCallList(index);
return;
} else {
index = gl.glGenLists(1);
! displayLists.put(space, index);
gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE);
}
}
}
Set<Geometric> hidden = new HashSet();
hidden.addAll(camera.getHiddenGeometrics());
--- 823,877 ----
private static void draw(Space space, boolean inside) {
if (space.isInstance()) {
! drawInstance(space, inside);
! } else {
! drawSpace(space, inside);
}
! }
!
! private static void drawInstance(Space space, boolean inside) {
! translateToCoordinatesystem(space);
! if (USEDL) {
! Space work = space.getProto();
if (selecting) {
! Integer index = displayListsSelecting.get(work);
if (index != null) {
gl.glCallList(index);
+ gl.glPopMatrix();
return;
} else {
index = gl.glGenLists(1);
! displayListsSelecting.put(work, index);
gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE);
}
} else {
! Integer index = displayLists.get(work);
if (index != null) {
gl.glCallList(index);
+ gl.glPopMatrix();
return;
} else {
index = gl.glGenLists(1);
! displayLists.put(work, index);
gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE);
}
}
}
+
+ if (selecting() && active == space.getOwner()) {
+ push(space);
+ }
+ drawSpace(space.getProto(), inside || active == space.getProto());
+ if (selecting() && active == space.getOwner()) {
+ pop();
+ }
+
+ if (USEDL) {
+ //will only reach here if a displaylist are being generated
+ gl.glEndList();
+ }
+ gl.glPopMatrix();
+ }
+
+ private static void drawSpace(Space space, boolean inside) {
Set<Geometric> hidden = new HashSet();
hidden.addAll(camera.getHiddenGeometrics());
***************
*** 1053,1066 ****
}
}
- if (space.isLocked() && USEDL) {
- //will only reach here if a displaylist are being generated
- gl.glEndList();
- }
for (Space current : elements) {
draw(current, inside || (current == active));
}
- if (space.isInstance()) {
- gl.glPopMatrix();
- }
}
--- 1079,1085 ----
|