OSDN Git Service

cached method id for getting buffer position. will still be a tad slow, but meh
authorbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Mon, 11 Jun 2012 00:48:38 +0000 (00:48 +0000)
committerbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Mon, 11 Jun 2012 00:48:38 +0000 (00:48 +0000)
20 files changed:
backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Beans.dll
backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Charsets.dll
backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Core.dll
backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Misc.dll
backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Text.dll
backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Util.dll
backends/gdx-backend-iosmonotouch/libs/IKVM.Reflection.dll
backends/gdx-backend-iosmonotouch/libs/IKVM.Runtime.JNI.dll
backends/gdx-backend-iosmonotouch/libs/IKVM.Runtime.dll
backends/gdx-backend-iosmonotouch/libs/IKVM.Runtime.dll.mdb
backends/gdx-backend-iosmonotouch/libs/ikvm.exe
backends/gdx-backend-iosmonotouch/libs/ikvmc.exe
backends/gdx-backend-iosmonotouch/libs/ikvmstub.exe
backends/gdx-backend-iosmonotouch/libs/libgdx.a
backends/gdx-backend-iosmonotouch/libs/libikvm-natives.a
backends/gdx-backend-iosmonotouch/mono/mono/Main.cs
backends/gdx-backend-iosmonotouch/mono/mono/libgdx.a
backends/gdx-backend-iosmonotouch/mono/mono/libikvm-natives.a
backends/gdx-backend-iosmonotouch/natives/iosgles20.cpp
backends/gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSGLES20.java

index edc42d9..ef65c9c 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Beans.dll and b/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Beans.dll differ
index 0d5fbae..8b4d9d5 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Charsets.dll and b/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Charsets.dll differ
index b426989..2441c1d 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Core.dll and b/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Core.dll differ
index 5a04074..77b50ba 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Misc.dll and b/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Misc.dll differ
index 261c007..4a1f548 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Text.dll and b/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Text.dll differ
index 97bc4cc..8ae3c42 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Util.dll and b/backends/gdx-backend-iosmonotouch/libs/IKVM.OpenJDK.Util.dll differ
index 66c966a..b674501 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/IKVM.Reflection.dll and b/backends/gdx-backend-iosmonotouch/libs/IKVM.Reflection.dll differ
index bbd0e40..40d7969 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/IKVM.Runtime.JNI.dll and b/backends/gdx-backend-iosmonotouch/libs/IKVM.Runtime.JNI.dll differ
index fc760bf..dc1c0bd 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/IKVM.Runtime.dll and b/backends/gdx-backend-iosmonotouch/libs/IKVM.Runtime.dll differ
index 8464292..3968621 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/IKVM.Runtime.dll.mdb and b/backends/gdx-backend-iosmonotouch/libs/IKVM.Runtime.dll.mdb differ
index f90af90..99ba1d4 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/ikvm.exe and b/backends/gdx-backend-iosmonotouch/libs/ikvm.exe differ
index ad5d312..9eaf64a 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/ikvmc.exe and b/backends/gdx-backend-iosmonotouch/libs/ikvmc.exe differ
index 727c574..a9c2039 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/ikvmstub.exe and b/backends/gdx-backend-iosmonotouch/libs/ikvmstub.exe differ
index fe47e8e..c473644 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/libgdx.a and b/backends/gdx-backend-iosmonotouch/libs/libgdx.a differ
index 158ccb6..fcdd1ba 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/libs/libikvm-natives.a and b/backends/gdx-backend-iosmonotouch/libs/libikvm-natives.a differ
index ffd4aec..0d4c483 100644 (file)
@@ -50,8 +50,8 @@ namespace mono
                                Gdx.app.log("ShaderTest", shader.getLog());
                                Gdx.app.exit();
                        }
-       
-                       mesh = new Mesh(true, 4, 6, VertexAttribute.Position(), VertexAttribute.ColorUnpacked(), VertexAttribute.TexCoords(0));
+        
+                       mesh = new Mesh(Mesh.VertexDataType.VertexArray, true, 4, 6, VertexAttribute.Position(), VertexAttribute.ColorUnpacked(), VertexAttribute.TexCoords(0));
                        mesh.setVertices(new float[] {-0.5f, -0.5f, 0, 1, 1, 1, 1, 0, 1, 
                                                                                                         0.5f, -0.5f, 0, 1, 1, 1, 1, 1, 1, 
                                                                                                         0.5f, 0.5f, 0, 1, 1, 1, 1, 1, 0, 
index 032a0b0..c473644 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/mono/mono/libgdx.a and b/backends/gdx-backend-iosmonotouch/mono/mono/libgdx.a differ
index d152f95..fcdd1ba 100644 (file)
Binary files a/backends/gdx-backend-iosmonotouch/mono/mono/libikvm-natives.a and b/backends/gdx-backend-iosmonotouch/mono/mono/libikvm-natives.a differ
index 2564810..7aafe9e 100644 (file)
@@ -1,6 +1,7 @@
 #include <iosgles20.h>\r
 #include <OpenGLES/ES2/gl.h>\r
 #include <OpenGLES/ES2/glext.h>\r
+#include <stdio.h>\r
 \r
 static jclass bufferClass;\r
 static jclass byteBufferClass;\r
@@ -66,6 +67,12 @@ static jint getElementSizeShift(JNIEnv *_env, jobject buffer) {
        return 0;\r
 }\r
 \r
+inline jint getBufferPosition(JNIEnv *env, jobject buffer)\r
+{\r
+       jint ret = env->CallIntMethodA(buffer, positionID, 0);\r
+       return  ret;\r
+}\r
+\r
 static void *\r
 getDirectBufferPointer(JNIEnv *_env, jobject buffer) {\r
     if (!buffer) {\r
@@ -73,7 +80,7 @@ getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
     }\r
     void* buf = _env->GetDirectBufferAddress(buffer);\r
     if (buf) {\r
-        jint position = _env->CallIntMethod(bufferClass, positionID, buffer);\r
+        jint position = getBufferPosition(_env, buffer);\r
         jint elementSizeShift = getElementSizeShift(_env, buffer);\r
         buf = ((char*) buf) + (position << elementSizeShift);\r
     } else {\r
index d229746..cfd1d30 100644 (file)
@@ -4,6 +4,7 @@ import java.nio.Buffer;
 import java.nio.FloatBuffer;\r
 import java.nio.IntBuffer;\r
 \r
+import com.badlogic.gdx.Gdx;\r
 import com.badlogic.gdx.graphics.GL20;\r
 import com.badlogic.gdx.graphics.GLCommon;\r
 \r