OSDN Git Service

fixed issue 1247, continuous rendering methods in GwtGraphics
authorMario Zechner <contact@badlogicgames.com>
Tue, 19 Feb 2013 14:18:02 +0000 (15:18 +0100)
committerMario Zechner <contact@badlogicgames.com>
Tue, 19 Feb 2013 14:18:02 +0000 (15:18 +0100)
backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtGraphics.java
tests/gdx-tests/src/com/badlogic/gdx/tests/PixmapPackerTest.java

index b58dec4..2973295 100644 (file)
@@ -275,17 +275,15 @@ public class GwtGraphics implements Graphics {
 \r
        @Override\r
        public void setContinuousRendering (boolean isContinuous) {\r
-               throw new GdxRuntimeException("No supported");\r
        }\r
 \r
        @Override\r
        public boolean isContinuousRendering () {\r
-               throw new GdxRuntimeException("No supported");\r
+               return false;\r
        }\r
 \r
        @Override\r
        public void requestRendering () {\r
-               throw new GdxRuntimeException("No supported");\r
        }\r
 \r
        @Override\r
index 94c2daa..1eb212f 100644 (file)
@@ -5,9 +5,11 @@ import com.badlogic.gdx.graphics.GL10;
 import com.badlogic.gdx.graphics.OrthographicCamera;
 import com.badlogic.gdx.graphics.Pixmap;
 import com.badlogic.gdx.graphics.Pixmap.Format;
+import com.badlogic.gdx.graphics.PixmapIO;
 import com.badlogic.gdx.graphics.Texture;
 import com.badlogic.gdx.graphics.Texture.TextureFilter;
 import com.badlogic.gdx.graphics.g2d.PixmapPacker;
+import com.badlogic.gdx.graphics.g2d.PixmapPacker.Page;
 import com.badlogic.gdx.graphics.g2d.SpriteBatch;
 import com.badlogic.gdx.graphics.g2d.TextureAtlas;
 import com.badlogic.gdx.tests.utils.GdxTest;
@@ -32,10 +34,14 @@ public class PixmapPackerTest extends GdxTest {
                Pixmap pixmap2 = new Pixmap(Gdx.files.internal("data/wheel.png"));
                Pixmap pixmap3 = new Pixmap(Gdx.files.internal("data/egg.png"));
                
-               PixmapPacker packer =  new PixmapPacker(256, 256, Format.RGBA8888, 2, true);
+               PixmapPacker packer =  new PixmapPacker(1024, 1024, Format.RGBA8888, 2, true);
                packer.pack("badlogic", pixmap1);
                packer.pack("wheel", pixmap1);
-               packer.pack("egg", pixmap1);
+               packer.pack("egg", pixmap1);            
+               
+               for(Page page: packer.getPages()) {
+                       PixmapIO.writePNG(Gdx.files.absolute("out.png"), page.getPixmap());
+               }
                
                atlas = packer.generateTextureAtlas(TextureFilter.Nearest, TextureFilter.Nearest, false);
                Gdx.app.log("PixmaPackerTest", "Number of textures: " + atlas.getTextures().size());