OSDN Git Service

[changed] Minor stuff.
authornathan.sweet <nathan.sweet@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Sun, 14 Nov 2010 11:03:45 +0000 (11:03 +0000)
committernathan.sweet <nathan.sweet@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Sun, 14 Nov 2010 11:03:45 +0000 (11:03 +0000)
backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidTexture.java
backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplication.java
backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglNativesLoader.java
gdx/src/com/badlogic/gdx/graphics/SpriteBatch.java

index 84d5464..d6cf86e 100644 (file)
@@ -183,7 +183,6 @@ final class AndroidTexture implements Texture {
                int level = 0;\r
                int height = bitmap.getHeight();\r
                int width = bitmap.getWidth();\r
-               Log.d("texture", "creating texture mipmaps: " + bitmap.getWidth() + ", " + bitmap.getHeight());\r
 \r
                if (!MathUtils.isPowerOfTwo(bitmap.getWidth()) || !MathUtils.isPowerOfTwo(bitmap.getHeight()))\r
                        throw new GdxRuntimeException("Dimensions have to be a power of two");\r
@@ -197,6 +196,7 @@ final class AndroidTexture implements Texture {
                        level++;\r
                        if (height > 1) height /= 2;\r
                        if (width > 1) width /= 2;\r
+                       Log.d("GDX", "Creating texture mipmap: " + width + ", " + height);\r
 \r
                        Bitmap bitmap2 = Bitmap.createScaledBitmap(bitmap, width, height, true);\r
                        if (level > 1) bitmap.recycle();\r
index f94b71a..36db67b 100644 (file)
@@ -87,18 +87,14 @@ public class LwjglApplication implements Application {
                        graphics.updateTime();\r
                        input.update();\r
 \r
-                       int width, height;\r
                        if (graphics.canvas != null) {\r
-                               width = graphics.canvas.getWidth();\r
-                               height = graphics.canvas.getHeight();\r
-                       } else {\r
-                               width = graphics.getWidth();\r
-                               height = graphics.getHeight();\r
-                       }\r
-                       if (lastWidth != width || lastHeight != height) {\r
-                               lastWidth = width;\r
-                               lastHeight = height;\r
-                               listener.resize(lastWidth, lastHeight);\r
+                               int width = graphics.canvas.getWidth();\r
+                               int height = graphics.canvas.getHeight();\r
+                               if (lastWidth != width || lastHeight != height) {\r
+                                       lastWidth = width;\r
+                                       lastHeight = height;\r
+                                       listener.resize(lastWidth, lastHeight);\r
+                               }\r
                        }\r
 \r
                        listener.render();\r
index e20cf73..aeb8534 100644 (file)
@@ -54,6 +54,8 @@ final class LwjglNativesLoader {
        }\r
 \r
        private static void loadLibrary (String libName, String classPath, String outputPath) {\r
+               if (new File(outputPath + libName).exists()) return;\r
+               \r
                InputStream in = null;\r
                BufferedOutputStream out = null;\r
 \r
index 3ee06fa..fdf2fbb 100644 (file)
@@ -704,9 +704,7 @@ public class SpriteBatch {
                        lastTexture = texture;\r
                        invTexWidth = 1.0f / texture.getWidth();\r
                        invTexHeight = 1.0f / texture.getHeight();\r
-               }\r
-\r
-               if (idx + length >= vertices.length)\r
+               } else if (idx + length >= vertices.length)\r
                        renderMesh();\r
 \r
                System.arraycopy(spriteVertices, offset, vertices, idx, length);\r