aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/share
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2013-03-17 12:49:53 -0700
committerHarvey Harrison <[email protected]>2013-03-17 16:12:58 -0700
commit7ba0895e3c1cef33f6ed840afa06b1eaf69b45c7 (patch)
tree936edfd82baecfee8e59958fd6e46b34362797a8 /src/classes/share
parentf01f6da0189465fe636807e7e943cfeb905062fb (diff)
j3dcore: use nio buffers directly for vertex normals
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes/share')
-rw-r--r--src/classes/share/javax/media/j3d/GeometryArrayRetained.java10
-rw-r--r--src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java4
-rw-r--r--src/classes/share/javax/media/j3d/JoglPipeline.java8
-rw-r--r--src/classes/share/javax/media/j3d/NoopPipeline.java4
-rw-r--r--src/classes/share/javax/media/j3d/Pipeline.java4
5 files changed, 15 insertions, 15 deletions
diff --git a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java
index 5480e42..76f3acb 100644
--- a/src/classes/share/javax/media/j3d/GeometryArrayRetained.java
+++ b/src/classes/share/javax/media/j3d/GeometryArrayRetained.java
@@ -231,7 +231,7 @@ ArrayList<GeometryAtom> gaList = new ArrayList<GeometryAtom>(1);
// Used for NIO buffer normals
J3DBuffer normalRefBuffer = null;
- FloatBufferWrapper floatBufferRefNormals = null;
+ FloatBuffer floatBufferRefNormals = null;
// used for "by reference" vertex attrs
float[][] floatRefVertexAttrs = null;
@@ -2554,7 +2554,7 @@ ArrayList<ArrayList<MorphRetained>> morphUserLists = null;
Buffer vcoord = null;
Buffer cdataBuffer = null;
- Object normal=null;
+ FloatBuffer normal=null;
int vdefined = 0;
if((vertexType & PF) != 0) {
@@ -2575,7 +2575,7 @@ ArrayList<ArrayList<MorphRetained>> morphUserLists = null;
if((vertexType & NORMAL_DEFINED) != 0) {
vdefined |= NORMAL_FLOAT;
- normal = floatBufferRefNormals.getBufferAsObject();
+ normal = floatBufferRefNormals;
}
if ((vertexType & VATTR_DEFINED) != 0) {
@@ -9124,13 +9124,13 @@ ArrayList<ArrayList<MorphRetained>> morphUserLists = null;
// setup the normal with nio buffer
void setNormalRefBuffer(J3DBuffer normals) {
- FloatBufferWrapper bufferImpl = null;
+ FloatBuffer bufferImpl = null;
if (normals != null) {
if(normals.bufferType != J3DBuffer.Type.FLOAT)
throw new IllegalArgumentException(J3dI18N.getString("GeometryArray116"));
- bufferImpl = (FloatBufferWrapper)normals.getBufferImpl();
+ bufferImpl = (FloatBuffer)normals.getROBuffer();
assert bufferImpl.isDirect();
diff --git a/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java b/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java
index 813f780..d6b4bdb 100644
--- a/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java
+++ b/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java
@@ -1480,7 +1480,7 @@ abstract class IndexedGeometryArrayRetained extends GeometryArrayRetained {
Buffer vcoord = null;
Buffer cdataBuffer = null;
- Object normal=null;
+ FloatBuffer normal = null;
int vdefined = 0;
if((vertexType & PF) != 0) {
@@ -1500,7 +1500,7 @@ abstract class IndexedGeometryArrayRetained extends GeometryArrayRetained {
if((vertexType & NORMAL_DEFINED) != 0) {
vdefined |= NORMAL_FLOAT;
- normal = floatBufferRefNormals.getBufferAsObject();
+ normal = floatBufferRefNormals;
}
if ((vertexType & VATTR_DEFINED) != 0) {
diff --git a/src/classes/share/javax/media/j3d/JoglPipeline.java b/src/classes/share/javax/media/j3d/JoglPipeline.java
index 73ac238..cc228e8 100644
--- a/src/classes/share/javax/media/j3d/JoglPipeline.java
+++ b/src/classes/share/javax/media/j3d/JoglPipeline.java
@@ -252,7 +252,7 @@ class JoglPipeline extends Pipeline {
int initialColorIndex,
Buffer cdataBuffer,
float[] cfdata, byte[] cbdata,
- int initialNormalIndex, Object ndata,
+ int initialNormalIndex, FloatBuffer ndata,
int vertexAttrCount, int[] vertexAttrSizes,
int[] vertexAttrIndices, Object[] vertexAttrData,
int texCoordMapLength,
@@ -317,7 +317,7 @@ class JoglPipeline extends Pipeline {
// get normal array
if (normalsDefined) {
- norms = (FloatBuffer) ndata;
+ norms = ndata;
}
int[] sarray = null;
@@ -1834,7 +1834,7 @@ class JoglPipeline extends Pipeline {
Buffer vcoords,
Buffer cdataBuffer,
float[] cfdata, byte[] cbdata,
- Object ndata,
+ FloatBuffer ndata,
int vertexAttrCount, int[] vertexAttrSizes,
Object[] vertexAttrData,
int texCoordMapLength,
@@ -1909,7 +1909,7 @@ class JoglPipeline extends Pipeline {
// get normal array
if (normalsDefined) {
- norms = (FloatBuffer) ndata;
+ norms = ndata;
}
executeIndexedGeometryArrayVA(ctx, geo, geo_type,
diff --git a/src/classes/share/javax/media/j3d/NoopPipeline.java b/src/classes/share/javax/media/j3d/NoopPipeline.java
index 58dd538..6b57dbc 100644
--- a/src/classes/share/javax/media/j3d/NoopPipeline.java
+++ b/src/classes/share/javax/media/j3d/NoopPipeline.java
@@ -106,7 +106,7 @@ class NoopPipeline extends Pipeline {
int colorIndex,
Buffer cdataBuffer,
float[] cfdata, byte[] cbdata,
- int normalIndex, Object ndata,
+ int normalIndex, FloatBuffer ndata,
int vertexAttrCount, int[] vertexAttrSizes,
int[] vertexAttrIndex, Object[] vertexAttrData,
int texcoordmaplength,
@@ -253,7 +253,7 @@ class NoopPipeline extends Pipeline {
Buffer vcoords,
Buffer cdataBuffer,
float[] cfdata, byte[] cbdata,
- Object normal,
+ FloatBuffer normal,
int vertexAttrCount, int[] vertexAttrSizes,
Object[] vertexAttrData,
int texcoordmaplength,
diff --git a/src/classes/share/javax/media/j3d/Pipeline.java b/src/classes/share/javax/media/j3d/Pipeline.java
index 82f7bb7..bcfad61 100644
--- a/src/classes/share/javax/media/j3d/Pipeline.java
+++ b/src/classes/share/javax/media/j3d/Pipeline.java
@@ -203,7 +203,7 @@ public Pipeline run() {
int colorIndex,
Buffer cdataBuffer,
float[] cfdata, byte[] cbdata,
- int normalIndex, Object ndata,
+ int normalIndex, FloatBuffer ndata,
int vertexAttrCount, int[] vertexAttrSizes,
int[] vertexAttrIndex, Object[] vertexAttrData,
int texcoordmaplength,
@@ -362,7 +362,7 @@ public Pipeline run() {
Buffer vcoords,
Buffer cdataBuffer,
float[] cfdata, byte[] cbdata,
- Object normal,
+ FloatBuffer normal,
int vertexAttrCount, int[] vertexAttrSizes,
Object[] vertexAttrData,
int texcoordmaplength,