From ed6dedb409dc717f98eb39c8790ba80a11c1f97e Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Mon, 5 Dec 2011 17:35:24 +0000 Subject: [PATCH] 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 --- .../renderer/android/OGLESShaderRenderer.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java b/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java index dbb63ab62..cf1e3856e 100644 --- a/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java +++ b/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 buffers = mesh.getBuffers(); - for (Entry entry : buffers) { - VertexBuffer vb = entry.getValue(); + // IntMap buffers = mesh.getBuffers(); + ArrayList 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 buffers = mesh.getBuffers(); + //IntMap buffers = mesh.getBuffers(); + ArrayList 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 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