OSDN Git Service

[added] Sprite setSize.
authornathan.sweet <nathan.sweet@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Thu, 28 Oct 2010 07:38:01 +0000 (07:38 +0000)
committernathan.sweet <nathan.sweet@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Thu, 28 Oct 2010 07:38:01 +0000 (07:38 +0000)
[changed] Squeezed 2 fps out of ParticleEmitter.
[changed] Added TwlRenderer method for when the screen size changes.

extensions/particle-editor/src/com/badlogic/gdx/graphics/particles/ParticleEditor.java
extensions/twl/gdx-twl-tests/src/com/badlogic/gdx/twl/tests/TextAreaTest.java
extensions/twl/gdx-twl/src/com/badlogic/gdx/twl/renderer/TwlRenderer.java
gdx/src/com/badlogic/gdx/graphics/Sprite.java
gdx/src/com/badlogic/gdx/graphics/particles/ParticleEmitter.java
tests/gdx-tests-android/assets/data/test.p
tests/gdx-tests-desktop/data/test.p
tests/gdx-tests-desktop/src/com/badlogic/gdx/tests/desktop/JoglTestStarter.java
tests/gdx-tests-lwjgl/data/test.p
tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglTestStarter.java
tests/gdx-tests/src/com/badlogic/gdx/tests/ParticleEmitterTest.java

index f5bd1ef..4d84743 100644 (file)
@@ -115,7 +115,7 @@ public class ParticleEditor extends JFrame {
                                        addRow(new SpawnPanel(emitter.getSpawnShape(), ParticleEditor.this));\r
                                        addRow(new ScaledNumericPanel("Spawn Width", "Duration", emitter.getSpawnWidth()));\r
                                        addRow(new ScaledNumericPanel("Spawn Height", "Duration", emitter.getSpawnHeight()));\r
-                                       addRow(new ScaledNumericPanel("Size", "Life", emitter.getSize()));\r
+                                       addRow(new ScaledNumericPanel("Size", "Life", emitter.getScale()));\r
                                        addRow(new ScaledNumericPanel("Velocity", "Life", emitter.getVelocity()));\r
                                        addRow(new ScaledNumericPanel("Angle", "Life", emitter.getAngle()));\r
                                        addRow(new ScaledNumericPanel("Rotation", "Life", emitter.getRotation()));\r
@@ -274,7 +274,7 @@ public class ParticleEditor extends JFrame {
                        int viewWidth = Gdx.graphics.getWidth();\r
                        int viewHeight = Gdx.graphics.getHeight();\r
 \r
-                       spriteBatch.setProjectionMatrix(new Matrix4().setToOrtho(0, viewWidth, viewHeight, 0, 0, 1));\r
+                       spriteBatch.getProjectionMatrix().setToOrtho(0, viewWidth, viewHeight, 0, 0, 1);\r
 \r
                        synchronized (effect) {\r
                                effect.setPosition(viewWidth / 2, viewHeight / 2);\r
index 8523f90..33aa324 100644 (file)
@@ -75,7 +75,7 @@ public class TextAreaTest implements RenderListener {
        }\r
 \r
        public void surfaceChanged (int width, int height) {\r
-               gui.setSize();\r
+               TwlRenderer.updateSize(gui);\r
        }\r
 \r
        public void dispose () {\r
index 2821334..096aba8 100644 (file)
@@ -69,7 +69,7 @@ public class TwlRenderer implements Renderer {
        final SpriteBatch spriteBatch = new SpriteBatch();\r
 \r
        public TwlRenderer () {\r
-               spriteBatch.setProjectionMatrix(new Matrix4().setToOrtho(0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), 0, 0, 1));\r
+               spriteBatch.getProjectionMatrix().setToOrtho(0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), 0, 0, 1);\r
        }\r
 \r
        public GdxCacheContext createNewCacheContext () {\r
@@ -204,6 +204,14 @@ public class TwlRenderer implements Renderer {
                }\r
        }\r
 \r
+       static public void updateSize (GUI gui) {\r
+               Renderer renderer = gui.getRenderer();\r
+               if (!(renderer instanceof TwlRenderer)) throw new IllegalArgumentException("gui's renderer must be a TwlRenderer.");\r
+               ((TwlRenderer)renderer).spriteBatch.getProjectionMatrix().setToOrtho2D(0, 0, Gdx.graphics.getWidth(),\r
+                       Gdx.graphics.getHeight());\r
+               gui.setSize();\r
+       }\r
+\r
        static public GUI createGUI (Widget root, String themeFile, final FileType fileType) {\r
                TwlRenderer renderer = new TwlRenderer();\r
                GUI gui = new GUI(root, renderer, null);\r
index 882253a..098988f 100644 (file)
@@ -54,8 +54,8 @@ public class Sprite {
        }\r
 \r
        /**\r
-        * Sets the size and position where the sprite will be drawn, before scaling and rotation are applied. If origin, rotation, or\r
-        * scale are changed, it is slightly more efficient to set the bounds afterward.\r
+        * Sets the size and position of the sprite when drawn, before scaling and rotation are applied. If origin, rotation, or scale\r
+        * are changed, it is slightly more efficient to set the bounds afterward.\r
         */\r
        public void setBounds (float x, float y, float width, float height) {\r
                this.x = x;\r
@@ -84,8 +84,38 @@ public class Sprite {
        }\r
 \r
        /**\r
+        * Sets the size of the sprite when drawn, before scaling and rotation are applied. If origin, rotation, or scale are changed,\r
+        * it is slightly more efficient to set the size afterward. If both position and size are to be changed, it is better to use\r
+        * {@link #setBounds(float, float, float, float)}.\r
+        */\r
+       public void setSize (float width, float height) {\r
+               this.width = width;\r
+               this.height = height;\r
+\r
+               if (dirty) return;\r
+\r
+               float x2 = x + width;\r
+               float y2 = y + height;\r
+               float[] vertices = this.vertices;\r
+               vertices[X1] = x;\r
+               vertices[Y1] = y;\r
+\r
+               vertices[X2] = x;\r
+               vertices[Y2] = y2;\r
+\r
+               vertices[X3] = x2;\r
+               vertices[Y3] = y2;\r
+\r
+               vertices[X4] = x2;\r
+               vertices[Y4] = y;\r
+\r
+               if (rotation != 0 || scaleX != 1 || scaleY != 1) dirty = true;\r
+       }\r
+\r
+       /**\r
         * Sets the position where the sprite will be drawn. If origin, rotation, or scale are changed, it is slightly more efficient\r
-        * to set the position afterward.\r
+        * to set the position afterward. If both position and size are to be changed, it is better to use\r
+        * {@link #setBounds(float, float, float, float)}.\r
         */\r
        public void setPosition (float x, float y) {\r
                translate(x - this.x, y - this.y);\r
@@ -201,7 +231,6 @@ public class Sprite {
        }\r
 \r
        public void setColor (Color tint) {\r
-               this.color = tint;\r
                float color = tint.toFloatBits();\r
                float[] vertices = this.vertices;\r
                vertices[C1] = color;\r
@@ -211,10 +240,6 @@ public class Sprite {
        }\r
 \r
        public void setColor (float r, float g, float b, float a) {\r
-               color.r = r;\r
-               color.g = g;\r
-               color.b = b;\r
-               color.a = a;\r
                int intBits = ((int)(255 * a) << 24) | //\r
                        ((int)(255 * b) << 16) | //\r
                        ((int)(255 * g) << 8) | //\r
@@ -348,7 +373,17 @@ public class Sprite {
                return scaleY;\r
        }\r
 \r
+       /**\r
+        * Returns the color for this sprite. Changing the returned color will have no affect. {@link #setColor(Color)} or\r
+        * {@link #setColor(float, float, float, float)} must be used.\r
+        */\r
        public Color getColor () {\r
+               int intBits = Float.floatToIntBits(vertices[C1]);\r
+               Color color = this.color;\r
+               color.r = (intBits & 0xff) / 255f;\r
+               color.g = (intBits >> 8 & 0xff) / 255f;\r
+               color.b = (intBits >> 16 & 0xff) / 255f;\r
+               color.a = (intBits >> 24) / 255f;\r
                return color;\r
        }\r
 \r
index a555635..d2910f2 100644 (file)
@@ -4,28 +4,33 @@ package com.badlogic.gdx.graphics.particles;
 import java.io.BufferedReader;\r
 import java.io.IOException;\r
 import java.io.Writer;\r
+import java.math.BigInteger;\r
 import java.util.BitSet;\r
 \r
-import com.badlogic.gdx.Files.FileType;\r
-import com.badlogic.gdx.Gdx;\r
 import com.badlogic.gdx.graphics.GL10;\r
 import com.badlogic.gdx.graphics.Sprite;\r
 import com.badlogic.gdx.graphics.SpriteBatch;\r
 import com.badlogic.gdx.graphics.Texture;\r
-import com.badlogic.gdx.graphics.Texture.TextureFilter;\r
-import com.badlogic.gdx.graphics.Texture.TextureWrap;\r
 import com.badlogic.gdx.utils.MathUtils;\r
 \r
 // BOZO - Support point particles?\r
 // BOZO - Add a duplicate emitter button.\r
 \r
 public class ParticleEmitter {\r
+       static private final int UPDATE_SCALE = 1 << 0;\r
+       static private final int UPDATE_ANGLE = 1 << 1;\r
+       static private final int UPDATE_ROTATION = 1 << 2;\r
+       static private final int UPDATE_VELOCITY = 1 << 3;\r
+       static private final int UPDATE_WIND = 1 << 4;\r
+       static private final int UPDATE_GRAVITY = 1 << 5;\r
+       static private final int UPDATE_TINT = 1 << 6;\r
+\r
        private RangedNumericValue delayValue = new RangedNumericValue();\r
        private ScaledNumericValue lifeOffsetValue = new ScaledNumericValue();\r
        private RangedNumericValue durationValue = new RangedNumericValue();\r
        private ScaledNumericValue lifeValue = new ScaledNumericValue();\r
        private ScaledNumericValue emissionValue = new ScaledNumericValue();\r
-       private ScaledNumericValue sizeValue = new ScaledNumericValue();\r
+       private ScaledNumericValue scaleValue = new ScaledNumericValue();\r
        private ScaledNumericValue rotationValue = new ScaledNumericValue();\r
        private ScaledNumericValue velocityValue = new ScaledNumericValue();\r
        private ScaledNumericValue angleValue = new ScaledNumericValue();\r
@@ -50,6 +55,7 @@ public class ParticleEmitter {
        private BitSet active;\r
        private boolean firstUpdate;\r
        private boolean flipX, flipY;\r
+       private int updateFlags;\r
 \r
        private float emission, emissionDiff, emissionDelta;\r
        private float lifeOffset, lifeOffsetDiff;\r
@@ -80,7 +86,7 @@ public class ParticleEmitter {
 \r
                lifeValue.setHigh(1, 1);\r
 \r
-               sizeValue.setHigh(32, 32);\r
+               scaleValue.setHigh(32, 32);\r
 \r
                rotationValue.setLow(1, 360);\r
                rotationValue.setHigh(180, 180);\r
@@ -114,7 +120,7 @@ public class ParticleEmitter {
                emissionValue.load(emitter.emissionValue);\r
                lifeValue.load(emitter.lifeValue);\r
                lifeOffsetValue.load(emitter.lifeOffsetValue);\r
-               sizeValue.load(emitter.sizeValue);\r
+               scaleValue.load(emitter.scaleValue);\r
                rotationValue.load(emitter.rotationValue);\r
                velocityValue.load(emitter.velocityValue);\r
                angleValue.load(emitter.angleValue);\r
@@ -138,7 +144,7 @@ public class ParticleEmitter {
                durationValue.setAlwaysActive(true);\r
                emissionValue.setAlwaysActive(true);\r
                lifeValue.setAlwaysActive(true);\r
-               sizeValue.setAlwaysActive(true);\r
+               scaleValue.setAlwaysActive(true);\r
                transparencyValue.setAlwaysActive(true);\r
                spawnShapeValue.setAlwaysActive(true);\r
                spawnWidthValue.setAlwaysActive(true);\r
@@ -260,6 +266,15 @@ public class ParticleEmitter {
                spawnHeight = (int)spawnHeightValue.newLowValue();\r
                spawnHeightDiff = (int)spawnHeightValue.newHighValue();\r
                if (!spawnHeightValue.isRelative()) spawnHeightDiff -= spawnHeight;\r
+\r
+               updateFlags = 0;\r
+               if (angleValue.active && angleValue.timeline.length > 1) updateFlags |= UPDATE_ANGLE;\r
+               if (velocityValue.active && velocityValue.active) updateFlags |= UPDATE_VELOCITY;\r
+               if (scaleValue.timeline.length > 1) updateFlags |= UPDATE_SCALE;\r
+               if (rotationValue.active && rotationValue.timeline.length > 1) updateFlags |= UPDATE_ROTATION;\r
+               if (windValue.active && windValue.timeline.length > 1) updateFlags |= UPDATE_WIND;\r
+               if (gravityValue.active && gravityValue.timeline.length > 1) updateFlags |= UPDATE_GRAVITY;\r
+               if (tintValue.timeline.length > 1) updateFlags |= UPDATE_TINT;\r
        }\r
 \r
        public void activateParticle (int index) {\r
@@ -270,6 +285,7 @@ public class ParticleEmitter {
                }\r
 \r
                float percent = durationTimer / (float)duration;\r
+               int updateFlags = this.updateFlags;\r
 \r
                float offsetTime = lifeOffset + lifeOffsetDiff * lifeOffsetValue.getScale(percent);\r
                particle.life = particle.currentLife = life + lifeDiff * lifeValue.getScale(percent);\r
@@ -283,15 +299,19 @@ public class ParticleEmitter {
                particle.angle = angleValue.newLowValue();\r
                particle.angleDiff = angleValue.newHighValue();\r
                if (!angleValue.isRelative()) particle.angleDiff -= particle.angle;\r
+               if ((updateFlags & UPDATE_ANGLE) == 0) particle.angle = particle.angle + particle.angleDiff * angleValue.getScale(0);\r
 \r
-               particle.size = sizeValue.newLowValue() / texture.getWidth();\r
-               particle.sizeDiff = sizeValue.newHighValue() / texture.getWidth();\r
-               if (!sizeValue.isRelative()) particle.sizeDiff -= particle.size;\r
+               particle.scale = scaleValue.newLowValue() / texture.getWidth();\r
+               particle.scaleDiff = scaleValue.newHighValue() / texture.getWidth();\r
+               if (!scaleValue.isRelative()) particle.scaleDiff -= particle.scale;\r
+               if ((updateFlags & UPDATE_SCALE) == 0) particle.setScale(particle.scale + particle.scaleDiff * scaleValue.getScale(0));\r
 \r
                if (rotationValue.active) {\r
-                       particle.rotation = particle.currentRotation = rotationValue.newLowValue();\r
+                       particle.rotation = rotationValue.newLowValue();\r
                        particle.rotationDiff = rotationValue.newHighValue();\r
                        if (!rotationValue.isRelative()) particle.rotationDiff -= particle.rotation;\r
+                       if ((updateFlags & UPDATE_ROTATION) == 0)\r
+                               particle.setRotation(particle.rotation + particle.rotationDiff * rotationValue.getScale(0));\r
                }\r
 \r
                if (windValue.active) {\r
@@ -306,6 +326,15 @@ public class ParticleEmitter {
                        if (!gravityValue.isRelative()) particle.gravityDiff -= particle.gravity;\r
                }\r
 \r
+               if ((updateFlags & UPDATE_TINT) == 0) {\r
+                       float[] color = particle.tint;\r
+                       if (color == null) particle.tint = color = new float[3];\r
+                       float[] temp = tintValue.getColor(0);\r
+                       color[0] = temp[0];\r
+                       color[1] = temp[1];\r
+                       color[2] = temp[2];\r
+               }\r
+\r
                particle.transparency = transparencyValue.newLowValue();\r
                particle.transparencyDiff = transparencyValue.newHighValue() - particle.transparency;\r
 \r
@@ -370,10 +399,7 @@ public class ParticleEmitter {
                }\r
                }\r
 \r
-               particle.setRotation(particle.currentRotation);\r
                particle.setBounds(x - texture.getWidth() / 2, y - texture.getHeight() / 2, texture.getWidth(), texture.getHeight());\r
-\r
-               updateParticle(index, offsetTime);\r
        }\r
 \r
        public boolean updateParticle (int index, float delta) {\r
@@ -383,36 +409,36 @@ public class ParticleEmitter {
                particle.currentLife = life;\r
 \r
                float percent = 1 - particle.currentLife / particle.life;\r
+               int updateFlags = this.updateFlags;\r
 \r
-               particle.setScale(particle.size + particle.sizeDiff * sizeValue.getScale(percent));\r
+               if ((updateFlags & UPDATE_SCALE) != 0)\r
+                       particle.setScale(particle.scale + particle.scaleDiff * scaleValue.getScale(percent));\r
 \r
-               float angle = particle.angle + particle.angleDiff * angleValue.getScale(percent);\r
+               float angle = particle.angle;\r
+               if ((updateFlags & UPDATE_ANGLE) != 0) angle += particle.angleDiff * angleValue.getScale(percent);\r
 \r
-               if (rotationValue.active) {\r
+               if ((updateFlags & UPDATE_ROTATION) != 0) {\r
                        float rotation = particle.rotation + particle.rotationDiff * rotationValue.getScale(percent);\r
                        if (aligned) rotation += angle;\r
-                       rotation -= particle.currentRotation;\r
-                       if (rotation != 0) {\r
-                               particle.currentRotation += rotation;\r
-                               particle.rotate(rotation);\r
-                       }\r
+                       if (rotation != 0) particle.setRotation(rotation);\r
                }\r
 \r
-               if (velocityValue.active) {\r
+               if ((updateFlags & UPDATE_VELOCITY) != 0) {\r
                        float velocity = (particle.velocity + particle.velocityDiff * velocityValue.getScale(percent)) * delta;\r
-                       float velocityX = velocity;\r
-                       float velocityY = velocity;\r
-                       if (angleValue.active) {\r
-                               velocityX *= MathUtils.cosDeg(angle);\r
-                               velocityY *= MathUtils.sinDeg(angle);\r
-                       }\r
-                       if (windValue.active) velocityX += (particle.wind + particle.windDiff * windValue.getScale(percent)) * delta;\r
-                       if (gravityValue.active)\r
+                       float velocityX = velocity * MathUtils.cosDeg(angle);\r
+                       float velocityY = velocity * MathUtils.sinDeg(angle);\r
+                       if ((updateFlags & UPDATE_WIND) != 0)\r
+                               velocityX += (particle.wind + particle.windDiff * windValue.getScale(percent)) * delta;\r
+                       if ((updateFlags & UPDATE_GRAVITY) != 0)\r
                                velocityY += (particle.gravity + particle.gravityDiff * gravityValue.getScale(percent)) * delta;\r
                        particle.translate(velocityX, velocityY);\r
                }\r
 \r
-               float[] color = tintValue.getColor(percent);\r
+               float[] color;\r
+               if ((updateFlags & UPDATE_TINT) != 0)\r
+                       color = tintValue.getColor(percent);\r
+               else\r
+                       color = particle.tint;\r
                particle.setColor(color[0], color[1], color[2],\r
                        particle.transparency + particle.transparencyDiff * transparencyValue.getScale(percent));\r
 \r
@@ -467,8 +493,8 @@ public class ParticleEmitter {
                return lifeValue;\r
        }\r
 \r
-       public ScaledNumericValue getSize () {\r
-               return sizeValue;\r
+       public ScaledNumericValue getScale () {\r
+               return scaleValue;\r
        }\r
 \r
        public ScaledNumericValue getRotation () {\r
@@ -651,8 +677,8 @@ public class ParticleEmitter {
                spawnWidthValue.save(output);\r
                output.write("- Spawn Height - \n");\r
                spawnHeightValue.save(output);\r
-               output.write("- Size - \n");\r
-               sizeValue.save(output);\r
+               output.write("- Scale - \n");\r
+               scaleValue.save(output);\r
                output.write("- Velocity - \n");\r
                velocityValue.save(output);\r
                output.write("- Angle - \n");\r
@@ -701,7 +727,7 @@ public class ParticleEmitter {
                reader.readLine();\r
                spawnHeightValue.load(reader);\r
                reader.readLine();\r
-               sizeValue.load(reader);\r
+               scaleValue.load(reader);\r
                reader.readLine();\r
                velocityValue.load(reader);\r
                reader.readLine();\r
@@ -744,13 +770,14 @@ public class ParticleEmitter {
 \r
        static class Particle extends Sprite {\r
                float life, currentLife;\r
-               float size, sizeDiff;\r
-               float rotation, currentRotation, rotationDiff;\r
+               float scale, scaleDiff;\r
+               float rotation, rotationDiff;\r
                float velocity, velocityDiff;\r
                float angle, angleDiff;\r
                float transparency, transparencyDiff;\r
                float wind, windDiff;\r
                float gravity, gravityDiff;\r
+               float[] tint;\r
 \r
                public Particle (Texture texture) {\r
                        super(texture);\r
@@ -882,7 +909,7 @@ public class ParticleEmitter {
 \r
        static public class ScaledNumericValue extends RangedNumericValue {\r
                private float[] scaling = {1};\r
-               private float[] timeline = {0};\r
+               float[] timeline = {0};\r
                private float highMin, highMax;\r
                private boolean relative;\r
 \r
@@ -1003,7 +1030,7 @@ public class ParticleEmitter {
                static private float[] temp = new float[4];\r
 \r
                private float[] colors = {1, 1, 1};\r
-               private float[] timeline = {0};\r
+               float[] timeline = {0};\r
 \r
                public GradientColorValue () {\r
                        alwaysActive = true;\r
index 10d8845..a273ab3 100644 (file)
@@ -5,7 +5,7 @@ active: false
 lowMin: 1.0
 lowMax: 1.0
 - Count - 
-min: 10
+min: 0
 max: 1000
 - Emission - 
 lowMin: 0.0
@@ -55,7 +55,7 @@ scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 32.0
@@ -69,8 +69,8 @@ timeline0: 0.0
 active: true
 lowMin: 0.0
 lowMax: 0.0
-highMin: 80.0
-highMax: 80.0
+highMin: 120.0
+highMax: 120.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -123,7 +123,7 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data/particle.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle.png
 
 
 fire
@@ -133,7 +133,7 @@ active: false
 lowMin: 1.0
 lowMax: 1.0
 - Count - 
-min: 10
+min: 0
 max: 1000
 - Emission - 
 lowMin: 0.0
@@ -148,8 +148,8 @@ timeline0: 0.0
 - Life - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 0.7
-highMax: 1.3
+highMin: 1.0
+highMax: 1.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -183,7 +183,7 @@ scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 80.0
@@ -197,8 +197,8 @@ timeline0: 0.0
 active: true
 lowMin: 0.0
 lowMax: 0.0
-highMin: 40.0
-highMax: 40.0
+highMin: 50.0
+highMax: 50.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -235,7 +235,7 @@ active: false
 - Tint - 
 colorsCount: 3
 colors0: 1.0
-colors1: 0.21176471
+colors1: 0.3372549
 colors2: 0.0
 timelineCount: 1
 timeline0: 0.0
@@ -245,16 +245,14 @@ lowMax: 0.0
 highMin: 1.0
 highMax: 1.0
 relative: false
-scalingCount: 4
-scaling0: 0.0
+scalingCount: 3
+scaling0: 1.0
 scaling1: 1.0
-scaling2: 1.0
-scaling3: 0.0
-timelineCount: 4
+scaling2: 0.0
+timelineCount: 3
 timeline0: 0.0
-timeline1: 0.2
-timeline2: 0.6712329
-timeline3: 1.0
+timeline1: 0.6712329
+timeline2: 1.0
 - Options - 
 attached: true
 continuous: true
@@ -262,7 +260,7 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data\particle-fire.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle-fire.png
 
 
 stars
@@ -288,7 +286,7 @@ timeline0: 0.0
 lowMin: 0.0
 lowMax: 0.0
 highMin: 1.0
-highMax: 1.0
+highMax: 1.5
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -322,7 +320,7 @@ scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 64.0
@@ -346,8 +344,8 @@ timeline5: 0.70547944
 active: true
 lowMin: 0.0
 lowMax: 0.0
-highMin: 80.0
-highMax: 80.0
+highMin: 100.0
+highMax: 120.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -355,21 +353,23 @@ timelineCount: 1
 timeline0: 0.0
 - Angle - 
 active: true
-lowMin: 0.0
-lowMax: 0.0
-highMin: 1.0
-highMax: 360.0
-relative: false
-scalingCount: 1
-scaling0: 1.0
-timelineCount: 1
+lowMin: 1.0
+lowMax: 360.0
+highMin: -180.0
+highMax: 180.0
+relative: true
+scalingCount: 2
+scaling0: 0.0
+scaling1: 1.0
+timelineCount: 2
 timeline0: 0.0
+timeline1: 0.51369864
 - Rotation - 
 active: true
 lowMin: 1.0
 lowMax: 360.0
-highMin: -90.0
-highMax: 89.0
+highMin: -360.0
+highMax: 360.0
 relative: true
 scalingCount: 2
 scaling0: 0.0
@@ -410,7 +410,7 @@ scaling3: 0.0
 scaling4: 1.0
 timelineCount: 5
 timeline0: 0.0
-timeline1: 0.25342464
+timeline1: 0.34246576
 timeline2: 0.74657536
 timeline3: 0.9315069
 timeline4: 1.0
@@ -421,7 +421,7 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data\particle-star.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle-star.png
 
 
 smoke
@@ -436,8 +436,8 @@ max: 1000
 - Emission - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 10.0
-highMax: 10.0
+highMin: 3.0
+highMax: 3.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -464,8 +464,8 @@ shape: square
 - Spawn Width - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 480.0
-highMax: 480.0
+highMin: 180.0
+highMax: 180.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -474,14 +474,14 @@ timeline0: 0.0
 - Spawn Height - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 320.0
-highMax: 320.0
+highMin: 110.0
+highMax: 110.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 256.0
@@ -493,10 +493,10 @@ timelineCount: 1
 timeline0: 0.0
 - Velocity - 
 active: true
-lowMin: 10.0
-lowMax: 10.0
-highMin: 0.0
-highMax: 0.0
+lowMin: -25.0
+lowMax: -25.0
+highMin: 25.0
+highMax: 25.0
 relative: false
 scalingCount: 2
 scaling0: 0.0
@@ -519,8 +519,8 @@ timeline0: 0.0
 active: true
 lowMin: 1.0
 lowMax: 360.0
-highMin: 3.0
-highMax: 10.0
+highMin: -30.0
+highMax: 30.0
 relative: true
 scalingCount: 2
 scaling0: 0.0
@@ -551,7 +551,7 @@ highMax: 1.0
 relative: false
 scalingCount: 3
 scaling0: 0.0
-scaling1: 0.2631579
+scaling1: 0.49122807
 scaling2: 0.0
 timelineCount: 3
 timeline0: 0.0
@@ -564,4 +564,4 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data\particle-cloud.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle-cloud.png
index 10d8845..a273ab3 100644 (file)
@@ -5,7 +5,7 @@ active: false
 lowMin: 1.0
 lowMax: 1.0
 - Count - 
-min: 10
+min: 0
 max: 1000
 - Emission - 
 lowMin: 0.0
@@ -55,7 +55,7 @@ scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 32.0
@@ -69,8 +69,8 @@ timeline0: 0.0
 active: true
 lowMin: 0.0
 lowMax: 0.0
-highMin: 80.0
-highMax: 80.0
+highMin: 120.0
+highMax: 120.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -123,7 +123,7 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data/particle.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle.png
 
 
 fire
@@ -133,7 +133,7 @@ active: false
 lowMin: 1.0
 lowMax: 1.0
 - Count - 
-min: 10
+min: 0
 max: 1000
 - Emission - 
 lowMin: 0.0
@@ -148,8 +148,8 @@ timeline0: 0.0
 - Life - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 0.7
-highMax: 1.3
+highMin: 1.0
+highMax: 1.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -183,7 +183,7 @@ scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 80.0
@@ -197,8 +197,8 @@ timeline0: 0.0
 active: true
 lowMin: 0.0
 lowMax: 0.0
-highMin: 40.0
-highMax: 40.0
+highMin: 50.0
+highMax: 50.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -235,7 +235,7 @@ active: false
 - Tint - 
 colorsCount: 3
 colors0: 1.0
-colors1: 0.21176471
+colors1: 0.3372549
 colors2: 0.0
 timelineCount: 1
 timeline0: 0.0
@@ -245,16 +245,14 @@ lowMax: 0.0
 highMin: 1.0
 highMax: 1.0
 relative: false
-scalingCount: 4
-scaling0: 0.0
+scalingCount: 3
+scaling0: 1.0
 scaling1: 1.0
-scaling2: 1.0
-scaling3: 0.0
-timelineCount: 4
+scaling2: 0.0
+timelineCount: 3
 timeline0: 0.0
-timeline1: 0.2
-timeline2: 0.6712329
-timeline3: 1.0
+timeline1: 0.6712329
+timeline2: 1.0
 - Options - 
 attached: true
 continuous: true
@@ -262,7 +260,7 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data\particle-fire.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle-fire.png
 
 
 stars
@@ -288,7 +286,7 @@ timeline0: 0.0
 lowMin: 0.0
 lowMax: 0.0
 highMin: 1.0
-highMax: 1.0
+highMax: 1.5
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -322,7 +320,7 @@ scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 64.0
@@ -346,8 +344,8 @@ timeline5: 0.70547944
 active: true
 lowMin: 0.0
 lowMax: 0.0
-highMin: 80.0
-highMax: 80.0
+highMin: 100.0
+highMax: 120.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -355,21 +353,23 @@ timelineCount: 1
 timeline0: 0.0
 - Angle - 
 active: true
-lowMin: 0.0
-lowMax: 0.0
-highMin: 1.0
-highMax: 360.0
-relative: false
-scalingCount: 1
-scaling0: 1.0
-timelineCount: 1
+lowMin: 1.0
+lowMax: 360.0
+highMin: -180.0
+highMax: 180.0
+relative: true
+scalingCount: 2
+scaling0: 0.0
+scaling1: 1.0
+timelineCount: 2
 timeline0: 0.0
+timeline1: 0.51369864
 - Rotation - 
 active: true
 lowMin: 1.0
 lowMax: 360.0
-highMin: -90.0
-highMax: 89.0
+highMin: -360.0
+highMax: 360.0
 relative: true
 scalingCount: 2
 scaling0: 0.0
@@ -410,7 +410,7 @@ scaling3: 0.0
 scaling4: 1.0
 timelineCount: 5
 timeline0: 0.0
-timeline1: 0.25342464
+timeline1: 0.34246576
 timeline2: 0.74657536
 timeline3: 0.9315069
 timeline4: 1.0
@@ -421,7 +421,7 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data\particle-star.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle-star.png
 
 
 smoke
@@ -436,8 +436,8 @@ max: 1000
 - Emission - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 10.0
-highMax: 10.0
+highMin: 3.0
+highMax: 3.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -464,8 +464,8 @@ shape: square
 - Spawn Width - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 480.0
-highMax: 480.0
+highMin: 180.0
+highMax: 180.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -474,14 +474,14 @@ timeline0: 0.0
 - Spawn Height - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 320.0
-highMax: 320.0
+highMin: 110.0
+highMax: 110.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 256.0
@@ -493,10 +493,10 @@ timelineCount: 1
 timeline0: 0.0
 - Velocity - 
 active: true
-lowMin: 10.0
-lowMax: 10.0
-highMin: 0.0
-highMax: 0.0
+lowMin: -25.0
+lowMax: -25.0
+highMin: 25.0
+highMax: 25.0
 relative: false
 scalingCount: 2
 scaling0: 0.0
@@ -519,8 +519,8 @@ timeline0: 0.0
 active: true
 lowMin: 1.0
 lowMax: 360.0
-highMin: 3.0
-highMax: 10.0
+highMin: -30.0
+highMax: 30.0
 relative: true
 scalingCount: 2
 scaling0: 0.0
@@ -551,7 +551,7 @@ highMax: 1.0
 relative: false
 scalingCount: 3
 scaling0: 0.0
-scaling1: 0.2631579
+scaling1: 0.49122807
 scaling2: 0.0
 timelineCount: 3
 timeline0: 0.0
@@ -564,4 +564,4 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data\particle-cloud.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle-cloud.png
index 84475a0..e7d6ab0 100644 (file)
@@ -56,7 +56,7 @@ public class JoglTestStarter {
        }\r
 \r
        public static void main (String[] argv) {\r
-               JFrame frame = new JFrame("Gdx - Jogl Test Launcher");\r
+               JFrame frame = new JFrame("GDX - Jogl Test Launcher");\r
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r
                frame.setContentPane(new TestList());\r
                frame.pack();\r
index 10d8845..a273ab3 100644 (file)
@@ -5,7 +5,7 @@ active: false
 lowMin: 1.0
 lowMax: 1.0
 - Count - 
-min: 10
+min: 0
 max: 1000
 - Emission - 
 lowMin: 0.0
@@ -55,7 +55,7 @@ scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 32.0
@@ -69,8 +69,8 @@ timeline0: 0.0
 active: true
 lowMin: 0.0
 lowMax: 0.0
-highMin: 80.0
-highMax: 80.0
+highMin: 120.0
+highMax: 120.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -123,7 +123,7 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data/particle.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle.png
 
 
 fire
@@ -133,7 +133,7 @@ active: false
 lowMin: 1.0
 lowMax: 1.0
 - Count - 
-min: 10
+min: 0
 max: 1000
 - Emission - 
 lowMin: 0.0
@@ -148,8 +148,8 @@ timeline0: 0.0
 - Life - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 0.7
-highMax: 1.3
+highMin: 1.0
+highMax: 1.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -183,7 +183,7 @@ scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 80.0
@@ -197,8 +197,8 @@ timeline0: 0.0
 active: true
 lowMin: 0.0
 lowMax: 0.0
-highMin: 40.0
-highMax: 40.0
+highMin: 50.0
+highMax: 50.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -235,7 +235,7 @@ active: false
 - Tint - 
 colorsCount: 3
 colors0: 1.0
-colors1: 0.21176471
+colors1: 0.3372549
 colors2: 0.0
 timelineCount: 1
 timeline0: 0.0
@@ -245,16 +245,14 @@ lowMax: 0.0
 highMin: 1.0
 highMax: 1.0
 relative: false
-scalingCount: 4
-scaling0: 0.0
+scalingCount: 3
+scaling0: 1.0
 scaling1: 1.0
-scaling2: 1.0
-scaling3: 0.0
-timelineCount: 4
+scaling2: 0.0
+timelineCount: 3
 timeline0: 0.0
-timeline1: 0.2
-timeline2: 0.6712329
-timeline3: 1.0
+timeline1: 0.6712329
+timeline2: 1.0
 - Options - 
 attached: true
 continuous: true
@@ -262,7 +260,7 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data\particle-fire.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle-fire.png
 
 
 stars
@@ -288,7 +286,7 @@ timeline0: 0.0
 lowMin: 0.0
 lowMax: 0.0
 highMin: 1.0
-highMax: 1.0
+highMax: 1.5
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -322,7 +320,7 @@ scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 64.0
@@ -346,8 +344,8 @@ timeline5: 0.70547944
 active: true
 lowMin: 0.0
 lowMax: 0.0
-highMin: 80.0
-highMax: 80.0
+highMin: 100.0
+highMax: 120.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -355,21 +353,23 @@ timelineCount: 1
 timeline0: 0.0
 - Angle - 
 active: true
-lowMin: 0.0
-lowMax: 0.0
-highMin: 1.0
-highMax: 360.0
-relative: false
-scalingCount: 1
-scaling0: 1.0
-timelineCount: 1
+lowMin: 1.0
+lowMax: 360.0
+highMin: -180.0
+highMax: 180.0
+relative: true
+scalingCount: 2
+scaling0: 0.0
+scaling1: 1.0
+timelineCount: 2
 timeline0: 0.0
+timeline1: 0.51369864
 - Rotation - 
 active: true
 lowMin: 1.0
 lowMax: 360.0
-highMin: -90.0
-highMax: 89.0
+highMin: -360.0
+highMax: 360.0
 relative: true
 scalingCount: 2
 scaling0: 0.0
@@ -410,7 +410,7 @@ scaling3: 0.0
 scaling4: 1.0
 timelineCount: 5
 timeline0: 0.0
-timeline1: 0.25342464
+timeline1: 0.34246576
 timeline2: 0.74657536
 timeline3: 0.9315069
 timeline4: 1.0
@@ -421,7 +421,7 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data\particle-star.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle-star.png
 
 
 smoke
@@ -436,8 +436,8 @@ max: 1000
 - Emission - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 10.0
-highMax: 10.0
+highMin: 3.0
+highMax: 3.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -464,8 +464,8 @@ shape: square
 - Spawn Width - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 480.0
-highMax: 480.0
+highMin: 180.0
+highMax: 180.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
@@ -474,14 +474,14 @@ timeline0: 0.0
 - Spawn Height - 
 lowMin: 0.0
 lowMax: 0.0
-highMin: 320.0
-highMax: 320.0
+highMin: 110.0
+highMax: 110.0
 relative: false
 scalingCount: 1
 scaling0: 1.0
 timelineCount: 1
 timeline0: 0.0
-- Size - 
+- Scale - 
 lowMin: 0.0
 lowMax: 0.0
 highMin: 256.0
@@ -493,10 +493,10 @@ timelineCount: 1
 timeline0: 0.0
 - Velocity - 
 active: true
-lowMin: 10.0
-lowMax: 10.0
-highMin: 0.0
-highMax: 0.0
+lowMin: -25.0
+lowMax: -25.0
+highMin: 25.0
+highMax: 25.0
 relative: false
 scalingCount: 2
 scaling0: 0.0
@@ -519,8 +519,8 @@ timeline0: 0.0
 active: true
 lowMin: 1.0
 lowMax: 360.0
-highMin: 3.0
-highMax: 10.0
+highMin: -30.0
+highMax: 30.0
 relative: true
 scalingCount: 2
 scaling0: 0.0
@@ -551,7 +551,7 @@ highMax: 1.0
 relative: false
 scalingCount: 3
 scaling0: 0.0
-scaling1: 0.2631579
+scaling1: 0.49122807
 scaling2: 0.0
 timelineCount: 3
 timeline0: 0.0
@@ -564,4 +564,4 @@ aligned: false
 additive: true
 behind: false
 - Image Path -
-data\particle-cloud.png
+\Dev\libgdx\tests\gdx-tests-lwjgl\data/particle-cloud.png
index 4d6e17f..1fe65f7 100644 (file)
@@ -54,7 +54,7 @@ public class LwjglTestStarter {
        }\r
 \r
        public static void main (String[] argv) {\r
-               JFrame frame = new JFrame("Gdx - LWJGL Test Launcher");\r
+               JFrame frame = new JFrame("GDX - LWJGL Test Launcher");\r
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r
                frame.setContentPane(new TestList());\r
                frame.pack();\r
index 761f2d4..09e3339 100644 (file)
@@ -19,26 +19,25 @@ import com.badlogic.gdx.graphics.Texture.TextureFilter;
 import com.badlogic.gdx.graphics.Texture.TextureWrap;\r
 import com.badlogic.gdx.graphics.particles.ParticleEffect;\r
 import com.badlogic.gdx.graphics.particles.ParticleEmitter;\r
+import com.badlogic.gdx.math.Matrix4;\r
 import com.badlogic.gdx.tests.utils.GdxTest;\r
 \r
 public class ParticleEmitterTest implements GdxTest {\r
        private SpriteBatch spriteBatch;\r
-       private BitmapFont font;\r
        ParticleEffect effect;\r
        int emitterIndex;\r
        ArrayList<ParticleEmitter> emitters;\r
        int particleCount = 10;\r
+       float fpsCounter;\r
 \r
        public void surfaceCreated () {\r
                if (spriteBatch != null) return;\r
                spriteBatch = new SpriteBatch();\r
 \r
-               font = new BitmapFont(Gdx.files.getFileHandle("data/verdana39.fnt", FileType.Internal), Gdx.files.getFileHandle(\r
-                       "data/verdana39.png", FileType.Internal), false);\r
-\r
                effect = new ParticleEffect();\r
                effect.load(Gdx.files.getFileHandle("data/test.p", FileType.Internal), "data", FileType.Internal);\r
                effect.setPosition(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2);\r
+               // Of course, a ParticleEffect is normally just used, without messing around with its emitters.\r
                emitters = new ArrayList(effect.getEmitters());\r
                effect.getEmitters().clear();\r
                effect.getEmitters().add(emitters.get(0));\r
@@ -72,32 +71,39 @@ public class ParticleEmitterTest implements GdxTest {
                                        particleCount += 5;\r
                                else if (keycode == Input.Keys.KEYCODE_DPAD_DOWN)\r
                                        particleCount -= 5;\r
-                               else if (keycode == Input.Keys.KEYCODE_SPACE)\r
+                               else if (keycode == Input.Keys.KEYCODE_SPACE) {\r
                                        emitterIndex = (emitterIndex + 1) % emitters.size();\r
-                               else\r
+                                       emitter = emitters.get(emitterIndex);\r
+                                       particleCount = (int)(emitter.getEmission().getHighMax() * emitter.getLife().getHighMax());\r
+                               } else\r
                                        return false;\r
                                particleCount = Math.max(0, particleCount);\r
                                if (particleCount > emitter.getMaxParticleCount()) emitter.setMaxParticleCount(particleCount * 2);\r
                                emitter.getEmission().setHigh(particleCount / emitter.getLife().getHighMax());\r
                                effect.getEmitters().clear();\r
-                               effect.getEmitters().add(emitters.get(emitterIndex));\r
+                               effect.getEmitters().add(emitter);\r
                                return false;\r
                        }\r
                });\r
        }\r
 \r
        public void surfaceChanged (int width, int height) {\r
+               spriteBatch.getProjectionMatrix().setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\r
        }\r
 \r
        public void render () {\r
+               float delta = Gdx.graphics.getDeltaTime();\r
                GL10 gl = Gdx.graphics.getGL10();\r
                gl.glClear(GL10.GL_COLOR_BUFFER_BIT);\r
                spriteBatch.begin();\r
-               effect.draw(spriteBatch, Gdx.graphics.getDeltaTime());\r
-               font.draw(spriteBatch, Gdx.graphics.getFramesPerSecond() + " fps", 5, 40, Color.WHITE);\r
-               int activeCount = emitters.get(emitterIndex).getActiveCount();\r
-               font.draw(spriteBatch, activeCount + "/" + particleCount + " particles", 5, Gdx.graphics.getHeight() - 5, Color.WHITE);\r
+               effect.draw(spriteBatch, delta);\r
                spriteBatch.end();\r
+               fpsCounter += delta;\r
+               if (fpsCounter > 3) {\r
+                       fpsCounter = 0;\r
+                       int activeCount = emitters.get(emitterIndex).getActiveCount();\r
+                       System.out.println(activeCount + "/" + particleCount + " particles, FPS: " + Gdx.graphics.getFramesPerSecond());\r
+               }\r
        }\r
 \r
        public void dispose () {\r