OGLESShaderRenderer : Changed Iteration on mesh buffer to use bufferList ArrayList instead of buffer IntMap. This fixes the non working animation issue on android. IntMap must be further investigated

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8867 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 13 years ago
parent 00d3e1a2f8
commit ed6dedb409
  1. 20
      engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java

@ -57,8 +57,6 @@ import com.jme3.texture.Image;
import com.jme3.texture.Texture;
import com.jme3.texture.Texture.WrapAxis;
import com.jme3.util.BufferUtils;
import com.jme3.util.IntMap;
import com.jme3.util.IntMap.Entry;
import com.jme3.util.ListMap;
import com.jme3.util.NativeObjectManager;
import java.nio.*;
@ -2643,9 +2641,10 @@ public class OGLESShaderRenderer implements Renderer {
logger.info("renderMeshVertexArray");
}
IntMap<VertexBuffer> buffers = mesh.getBuffers();
for (Entry<VertexBuffer> entry : buffers) {
VertexBuffer vb = entry.getValue();
// IntMap<VertexBuffer> buffers = mesh.getBuffers();
ArrayList<VertexBuffer> buffersList = mesh.getBufferList();
for (int i = 0; i < buffersList.size(); i++){
VertexBuffer vb = buffersList.get(i);
if (vb.getBufferType() == Type.InterleavedData
|| vb.getUsage() == Usage.CpuOnly // ignore cpu-only buffers
@ -2667,7 +2666,7 @@ public class OGLESShaderRenderer implements Renderer {
if (mesh.getNumLodLevels() > 0) {
indices = mesh.getLodLevel(lod);
} else {
indices = buffers.get(Type.Index.ordinal());
indices = mesh.getBuffer(Type.Index);//buffers.get(Type.Index.ordinal());
}
if (indices != null) {
drawTriangleList_Array(indices, mesh, count);
@ -2695,14 +2694,15 @@ public class OGLESShaderRenderer implements Renderer {
updateBufferData(interleavedData);
}
IntMap<VertexBuffer> buffers = mesh.getBuffers();
//IntMap<VertexBuffer> buffers = mesh.getBuffers();
ArrayList<VertexBuffer> buffersList = mesh.getBufferList();
if (mesh.getNumLodLevels() > 0) {
indices = mesh.getLodLevel(lod);
} else {
indices = buffers.get(Type.Index.ordinal());
indices = mesh.getBuffer(Type.Index);// buffers.get(Type.Index.ordinal());
}
for (Entry<VertexBuffer> entry : buffers) {
VertexBuffer vb = entry.getValue();
for (int i = 0; i < buffersList.size(); i++){
VertexBuffer vb = buffersList.get(i);
if (vb.getBufferType() == Type.InterleavedData
|| vb.getUsage() == Usage.CpuOnly // ignore cpu-only buffers

Loading…
Cancel
Save