OSDN Git Service

Use the typed array factory methods
authorJustin Shapcott <support@mobidevelop.com>
Thu, 23 May 2013 21:39:55 +0000 (14:39 -0700)
committerJustin Shapcott <support@mobidevelop.com>
Thu, 23 May 2013 21:39:55 +0000 (14:39 -0700)
backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtGL20.java

index cfedbb9..dd2244e 100644 (file)
@@ -30,13 +30,11 @@ import com.badlogic.gdx.graphics.GL20;
 import com.badlogic.gdx.graphics.Pixmap;\r
 import com.badlogic.gdx.utils.GdxRuntimeException;\r
 import com.google.gwt.core.client.GWT;\r
-import com.google.gwt.typedarrays.client.Float32ArrayNative;\r
-import com.google.gwt.typedarrays.client.Int16ArrayNative;\r
-import com.google.gwt.typedarrays.client.Int32ArrayNative;\r
 import com.google.gwt.typedarrays.client.Uint8ArrayNative;\r
 import com.google.gwt.typedarrays.shared.Float32Array;\r
 import com.google.gwt.typedarrays.shared.Int16Array;\r
 import com.google.gwt.typedarrays.shared.Int32Array;\r
+import com.google.gwt.typedarrays.shared.TypedArrays;\r
 import com.google.gwt.typedarrays.shared.Uint8Array;\r
 import com.google.gwt.webgl.client.WebGLActiveInfo;\r
 import com.google.gwt.webgl.client.WebGLBuffer;\r
@@ -65,9 +63,9 @@ public class GwtGL20 implements GL20 {
        int nextUniformId = 1;\r
        int currProgram = 0;\r
 \r
-       Float32Array floatBuffer = Float32ArrayNative.create(2000 * 20);\r
-       Int32Array intBuffer = Int32ArrayNative.create(2000 * 6);\r
-       Int16Array shortBuffer = Int16ArrayNative.create(2000 * 6);\r
+       Float32Array floatBuffer = TypedArrays.createFloat32Array(2000 * 20);\r
+       Int32Array intBuffer = TypedArrays.createInt32Array(2000 * 6);\r
+       Int16Array shortBuffer = TypedArrays.createInt16Array(2000 * 6);\r
        float[] floatArray = new float[16000];\r
 \r
        final WebGLRenderingContext gl;\r
@@ -80,19 +78,19 @@ public class GwtGL20 implements GL20 {
 \r
        private void ensureCapacity (FloatBuffer buffer) {\r
                if (buffer.remaining() > floatBuffer.length()) {\r
-                       floatBuffer = Float32ArrayNative.create(buffer.remaining());\r
+                       floatBuffer = TypedArrays.createFloat32Array(buffer.remaining());\r
                }\r
        }\r
 \r
        private void ensureCapacity (ShortBuffer buffer) {\r
                if (buffer.remaining() > shortBuffer.length()) {\r
-                       shortBuffer = Int16ArrayNative.create(buffer.remaining());\r
+                       shortBuffer = TypedArrays.createInt16Array(buffer.remaining());\r
                }\r
        }\r
        \r
        private void ensureCapacity (IntBuffer buffer) {\r
                if (buffer.remaining() > intBuffer.length()) {\r
-                       intBuffer = Int32ArrayNative.create(buffer.remaining());\r
+                       intBuffer = TypedArrays.createInt32Array(buffer.remaining());\r
                }\r
        }\r
 \r