Преглед изворни кода

Particle Emitter :
- fixed NPE when loading a ParticleEmitter from a j3o

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7942 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

rem..om пре 14 година
родитељ
комит
2b802d5272
1 измењених фајлова са 4 додато и 3 уклоњено
  1. 4 3
      engine/src/core/com/jme3/effect/ParticleEmitter.java

+ 4 - 3
engine/src/core/com/jme3/effect/ParticleEmitter.java

@@ -1132,7 +1132,7 @@ public class ParticleEmitter extends Geometry {
 
 
         meshType = ic.readEnum("meshType", ParticleMesh.Type.class, ParticleMesh.Type.Triangle);
         meshType = ic.readEnum("meshType", ParticleMesh.Type.class, ParticleMesh.Type.Triangle);
         int numParticles = ic.readInt("numParticles", 0);
         int numParticles = ic.readInt("numParticles", 0);
-        this.setNumParticles(numParticles);
+      
 
 
         enabled = ic.readBoolean("enabled", true);
         enabled = ic.readBoolean("enabled", true);
         particlesPerSec = ic.readFloat("particlesPerSec", 0);
         particlesPerSec = ic.readFloat("particlesPerSec", 0);
@@ -1164,8 +1164,9 @@ public class ParticleEmitter extends Geometry {
             default:
             default:
                 throw new IllegalStateException("Unrecognized particle type: " + meshType);
                 throw new IllegalStateException("Unrecognized particle type: " + meshType);
         }
         }
-        particleMesh.initParticleData(this, particles.length);
-        particleMesh.setImagesXY(imagesX, imagesY);
+        this.setNumParticles(numParticles);
+//        particleMesh.initParticleData(this, particles.length);
+//        particleMesh.setImagesXY(imagesX, imagesY);
 
 
         particleInfluencer = (ParticleInfluencer) ic.readSavable("influencer", DEFAULT_INFLUENCER);
         particleInfluencer = (ParticleInfluencer) ic.readSavable("influencer", DEFAULT_INFLUENCER);
         if (particleInfluencer == DEFAULT_INFLUENCER) {
         if (particleInfluencer == DEFAULT_INFLUENCER) {