diff options
author | Harvey Harrison <[email protected]> | 2013-03-17 12:07:28 -0700 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2013-03-17 12:07:28 -0700 |
commit | cba060748b5b4413cb6534aa02a6caec9791a13a (patch) | |
tree | 5b9c1a7c8efa962b9b6e7caaac72dc4f773c8010 /src | |
parent | 0dd6ef1cf40744abfa5fc7eb18ccd26a6cdddb12 (diff) |
j3dcore: directly use nio buffers internally in GeometryArrayRetained
Remove the use of FloatBufferWrapper, DoubleBufferWrapper.
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src')
5 files changed, 28 insertions, 22 deletions
diff --git a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java index e5c8684..e62d4d5 100644 --- a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java +++ b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java @@ -26,6 +26,9 @@ package javax.media.j3d; +import java.nio.Buffer; +import java.nio.DoubleBuffer; +import java.nio.FloatBuffer; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -150,8 +153,8 @@ ArrayList<GeometryAtom> gaList = new ArrayList<GeometryAtom>(1); // Used for NIO buffer geometry J3DBuffer coordRefBuffer = null; - FloatBufferWrapper floatBufferRefCoords = null; - DoubleBufferWrapper doubleBufferRefCoords = null; + FloatBuffer floatBufferRefCoords = null; + DoubleBuffer doubleBufferRefCoords = null; // Initial index to use for rendering int initialCoordIndex = 0; @@ -600,8 +603,8 @@ ArrayList<ArrayList<MorphRetained>> morphUserLists = null; } - // compute bounding box for coord with noi buffer - void computeBoundingBox( DoubleBufferWrapper buffer) { + // compute bounding box for coord with nio buffer + void computeBoundingBox( DoubleBuffer buffer) { int i, j, k, sIndex; double xmin, xmax, ymin, ymax, zmin, zmax; @@ -648,8 +651,8 @@ ArrayList<ArrayList<MorphRetained>> morphUserLists = null; } } - // compute bounding box for coord with noi buffer - void computeBoundingBox( FloatBufferWrapper buffer) { + // compute bounding box for coord with nio buffer + void computeBoundingBox( FloatBuffer buffer) { int i, j, k, sIndex; double xmin, xmax, ymin, ymax, zmin, zmax; @@ -2550,15 +2553,16 @@ ArrayList<ArrayList<MorphRetained>> morphUserLists = null; cdirty = dirtyFlag; } - Object vcoord = null, cdataBuffer=null, normal=null; + Buffer vcoord = null; + Object cdataBuffer=null, normal=null; int vdefined = 0; if((vertexType & PF) != 0) { vdefined |= COORD_FLOAT; - vcoord = floatBufferRefCoords.getBufferAsObject(); + vcoord = floatBufferRefCoords; } else if((vertexType & PD ) != 0) { vdefined |= COORD_DOUBLE; - vcoord = doubleBufferRefCoords.getBufferAsObject(); + vcoord = doubleBufferRefCoords; } if((vertexType & CF ) != 0) { @@ -8396,16 +8400,14 @@ ArrayList<ArrayList<MorphRetained>> morphUserLists = null; }else { switch (coords.bufferType) { case FLOAT: - floatBufferRefCoords = - (FloatBufferWrapper)coords.getBufferImpl(); + floatBufferRefCoords = (FloatBuffer)coords.getROBuffer(); doubleBufferRefCoords = null; vertexType |= PF; vertexType &= ~PD; break; case DOUBLE: floatBufferRefCoords = null; - doubleBufferRefCoords = - (DoubleBufferWrapper)coords.getBufferImpl(); + doubleBufferRefCoords = (DoubleBuffer)coords.getROBuffer(); vertexType |= PD; vertexType &= ~PF; break; diff --git a/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java b/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java index d864b96..47c9efa 100644 --- a/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java +++ b/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java @@ -26,6 +26,7 @@ package javax.media.j3d; +import java.nio.Buffer; import java.util.ArrayList; import javax.vecmath.TexCoord2f; @@ -1479,15 +1480,16 @@ abstract class IndexedGeometryArrayRetained extends GeometryArrayRetained { cdirty = dirtyFlag; } - Object vcoord = null, cdataBuffer=null, normal=null; + Buffer vcoord = null; + Object cdataBuffer=null, normal=null; int vdefined = 0; if((vertexType & PF) != 0) { vdefined |= COORD_FLOAT; - vcoord = floatBufferRefCoords.getBufferAsObject(); + vcoord = floatBufferRefCoords; } else if((vertexType & PD ) != 0) { vdefined |= COORD_DOUBLE; - vcoord = doubleBufferRefCoords.getBufferAsObject(); + vcoord = doubleBufferRefCoords; } if((vertexType & CF ) != 0) { vdefined |= COLOR_FLOAT; diff --git a/src/classes/share/javax/media/j3d/JoglPipeline.java b/src/classes/share/javax/media/j3d/JoglPipeline.java index 39094a8..977c650 100644 --- a/src/classes/share/javax/media/j3d/JoglPipeline.java +++ b/src/classes/share/javax/media/j3d/JoglPipeline.java @@ -248,7 +248,7 @@ class JoglPipeline extends Pipeline { int vformat, int vdefined, int initialCoordIndex, - Object vcoords, + Buffer vcoords, int initialColorIndex, Object cdataBuffer, float[] cfdata, byte[] cbdata, @@ -1831,7 +1831,7 @@ class JoglPipeline extends Pipeline { int vertexCount, int vformat, int vdefined, - Object vcoords, + Buffer vcoords, Object cdataBuffer, float[] cfdata, byte[] cbdata, Object ndata, diff --git a/src/classes/share/javax/media/j3d/NoopPipeline.java b/src/classes/share/javax/media/j3d/NoopPipeline.java index 2e92bfe..2800308 100644 --- a/src/classes/share/javax/media/j3d/NoopPipeline.java +++ b/src/classes/share/javax/media/j3d/NoopPipeline.java @@ -29,6 +29,7 @@ package javax.media.j3d; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; +import java.nio.Buffer; /** * Concrete implementation of Pipeline class for the noop rendering @@ -100,7 +101,7 @@ class NoopPipeline extends Pipeline { int vformat, int vdefined, int coordIndex, - Object vcoords, + Buffer vcoords, int colorIndex, Object cdataBuffer, float[] cfdata, byte[] cbdata, @@ -248,7 +249,7 @@ class NoopPipeline extends Pipeline { int vertexCount, int vformat, int vdefined, - Object vcoords, + Buffer vcoords, Object cdataBuffer, float[] cfdata, byte[] cbdata, Object normal, diff --git a/src/classes/share/javax/media/j3d/Pipeline.java b/src/classes/share/javax/media/j3d/Pipeline.java index 77da91d..63961a0 100644 --- a/src/classes/share/javax/media/j3d/Pipeline.java +++ b/src/classes/share/javax/media/j3d/Pipeline.java @@ -28,6 +28,7 @@ package javax.media.j3d; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; +import java.nio.Buffer; /** * Abstract pipeline class for rendering pipeline methods. All rendering @@ -197,7 +198,7 @@ public Pipeline run() { int vformat, int vdefined, int coordIndex, - Object vcoords, + Buffer vcoords, int colorIndex, Object cdataBuffer, float[] cfdata, byte[] cbdata, @@ -357,7 +358,7 @@ public Pipeline run() { int vertexCount, int vformat, int vdefined, - Object vcoords, + Buffer vcoords, Object cdataBuffer, float[] cfdata, byte[] cbdata, Object normal, |