OSDN Git Service

[fixed] bug in Mesh, affected indexed rendering with offsetting. doh.
authorbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Sat, 20 Nov 2010 01:02:34 +0000 (01:02 +0000)
committerbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Sat, 20 Nov 2010 01:02:34 +0000 (01:02 +0000)
gdx/src/com/badlogic/gdx/graphics/Mesh.java

index 11f955c..84fda37 100644 (file)
@@ -364,7 +364,7 @@ public class Mesh {
                } else {\r
                        if (indices.getNumIndices() > 0)\r
                                Gdx.gl11.glDrawElements(primitiveType, count,\r
-                                               GL10.GL_UNSIGNED_SHORT, offset);\r
+                                               GL10.GL_UNSIGNED_SHORT, offset * 2);\r
                        else\r
                                Gdx.gl11.glDrawArrays(primitiveType, offset, count);\r
                }\r
@@ -453,7 +453,7 @@ public class Mesh {
 \r
                if (indices.getNumIndices() > 0)\r
                        Gdx.gl20.glDrawElements(primitiveType, count,\r
-                                       GL10.GL_UNSIGNED_SHORT, offset);\r
+                                       GL10.GL_UNSIGNED_SHORT, offset * 2);\r
                else\r
                        Gdx.gl20.glDrawArrays(primitiveType, offset, count);\r
 \r