From: nathan.sweet Date: Sun, 14 Nov 2010 11:03:45 +0000 (+0000) Subject: [changed] Minor stuff. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a45599fbcb8a35b9b7f53fd46f96a6c2a12bca38;p=mikumikustudio%2Flibgdx-mikumikustudio.git [changed] Minor stuff. --- diff --git a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidTexture.java b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidTexture.java index 84d5464ed..d6cf86ec9 100644 --- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidTexture.java +++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidTexture.java @@ -183,7 +183,6 @@ final class AndroidTexture implements Texture { int level = 0; int height = bitmap.getHeight(); int width = bitmap.getWidth(); - Log.d("texture", "creating texture mipmaps: " + bitmap.getWidth() + ", " + bitmap.getHeight()); if (!MathUtils.isPowerOfTwo(bitmap.getWidth()) || !MathUtils.isPowerOfTwo(bitmap.getHeight())) throw new GdxRuntimeException("Dimensions have to be a power of two"); @@ -197,6 +196,7 @@ final class AndroidTexture implements Texture { level++; if (height > 1) height /= 2; if (width > 1) width /= 2; + Log.d("GDX", "Creating texture mipmap: " + width + ", " + height); Bitmap bitmap2 = Bitmap.createScaledBitmap(bitmap, width, height, true); if (level > 1) bitmap.recycle(); diff --git a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplication.java b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplication.java index f94b71a64..36db67ba5 100644 --- a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplication.java +++ b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplication.java @@ -87,18 +87,14 @@ public class LwjglApplication implements Application { graphics.updateTime(); input.update(); - int width, height; if (graphics.canvas != null) { - width = graphics.canvas.getWidth(); - height = graphics.canvas.getHeight(); - } else { - width = graphics.getWidth(); - height = graphics.getHeight(); - } - if (lastWidth != width || lastHeight != height) { - lastWidth = width; - lastHeight = height; - listener.resize(lastWidth, lastHeight); + int width = graphics.canvas.getWidth(); + int height = graphics.canvas.getHeight(); + if (lastWidth != width || lastHeight != height) { + lastWidth = width; + lastHeight = height; + listener.resize(lastWidth, lastHeight); + } } listener.render(); diff --git a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglNativesLoader.java b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglNativesLoader.java index e20cf73af..aeb8534bd 100644 --- a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglNativesLoader.java +++ b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglNativesLoader.java @@ -54,6 +54,8 @@ final class LwjglNativesLoader { } private static void loadLibrary (String libName, String classPath, String outputPath) { + if (new File(outputPath + libName).exists()) return; + InputStream in = null; BufferedOutputStream out = null; diff --git a/gdx/src/com/badlogic/gdx/graphics/SpriteBatch.java b/gdx/src/com/badlogic/gdx/graphics/SpriteBatch.java index 3ee06fa80..fdf2fbbd8 100644 --- a/gdx/src/com/badlogic/gdx/graphics/SpriteBatch.java +++ b/gdx/src/com/badlogic/gdx/graphics/SpriteBatch.java @@ -704,9 +704,7 @@ public class SpriteBatch { lastTexture = texture; invTexWidth = 1.0f / texture.getWidth(); invTexHeight = 1.0f / texture.getHeight(); - } - - if (idx + length >= vertices.length) + } else if (idx + length >= vertices.length) renderMesh(); System.arraycopy(spriteVertices, offset, vertices, idx, length);