Fixed ParticleSystem may using wrong texture if the particle PLIST file created via ParticleDesigner.

This commit is contained in:
WenhaiLin 2015-06-12 11:03:32 +08:00
parent 902f1696e8
commit 9f5a36b817
1 changed files with 2 additions and 2 deletions

View File

@ -367,7 +367,7 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string&
Texture2D *tex = nullptr;
if (textureName.length() > 0)
if (!textureName.empty())
{
// set not pop-up message box when load image failed
bool notify = FileUtils::getInstance()->isPopupNotify();
@ -404,7 +404,7 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string&
CCASSERT(isOK, "CCParticleSystem: error init image with Data");
CC_BREAK_IF(!isOK);
setTexture(Director::getInstance()->getTextureCache()->addImage(image, textureName.c_str()));
setTexture(Director::getInstance()->getTextureCache()->addImage(image, _plistFile + textureName));
image->release();
}