From ecfd84d825a955a8ecbfb3ba5ea234449da1a1fe Mon Sep 17 00:00:00 2001 From: dingpinglv Date: Wed, 22 May 2013 10:03:25 +0800 Subject: [PATCH] fixed #2144 fixed a bug of cc.ParticleSystemQuad that return null when call this._texture.getContentSize() in setTotalParticles at initialize particle from CCBReader --- cocos2d/particle_nodes/CCParticleSystemQuad.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cocos2d/particle_nodes/CCParticleSystemQuad.js b/cocos2d/particle_nodes/CCParticleSystemQuad.js index 0ca1127d37..18ca321cac 100644 --- a/cocos2d/particle_nodes/CCParticleSystemQuad.js +++ b/cocos2d/particle_nodes/CCParticleSystemQuad.js @@ -675,8 +675,10 @@ cc.ParticleSystemQuad = cc.ParticleSystem.extend(/** @lends cc.ParticleSystemQua this._setupVBO(); //set the texture coord - var size = this._texture.getContentSize(); - this.initTexCoordsWithRect(cc.rect(0, 0, size.width, size.height)); + if(this._texture){ + var size = this._texture.getContentSize(); + this.initTexCoordsWithRect(cc.rect(0, 0, size.width, size.height)); + } } else this._totalParticles = tp; this.resetSystem();