OSDN Git Service

modified SpriteBatch enableBlending() and disableBlending() methods to check if blend...
authorAriel Coppes <ariel.coppes@gemserk.com>
Sat, 6 Oct 2012 20:32:05 +0000 (17:32 -0300)
committerAriel Coppes <ariel.coppes@gemserk.com>
Sat, 6 Oct 2012 20:32:05 +0000 (17:32 -0300)
gdx/src/com/badlogic/gdx/graphics/g2d/SpriteBatch.java

index 6d6307a..3c9ad09 100644 (file)
@@ -1068,12 +1068,16 @@ public class SpriteBatch implements Disposable {
 \r
        /** Disables blending for drawing sprites. */\r
        public void disableBlending () {\r
+               if (blendingDisabled)\r
+                       return;\r
                renderMesh();\r
                blendingDisabled = true;\r
        }\r
 \r
        /** Enables blending for sprites */\r
        public void enableBlending () {\r
+               if (!blendingDisabled)\r
+                       return;\r
                renderMesh();\r
                blendingDisabled = false;\r
        }\r