Particle Texture becomes white after resume game


#1

version 1.0.1-0.12.0 android only.
steps to reproduce:
Add a particleSystem using a plist with imageData.
Run with Particle.
Press Home button.
return to Game.
Particle becomes white squares.


#2

OK, here I come up with a stupid fix first, for temporary use only , if anyone could help me to get a better fix, that will be great.

in the file CCParticleSystem.cpp

in method initWithDictionary:

modify following part of code as below:

char textureName = valueForKey;
std::string fullpath = CCFileUtils::fullPathFromRelativeFile);
CCTexture2D
tex = NULL;
if (strlen(textureName) > 0)
{
// set not pop-up message box when load image failed
bool bNotify = CCFileUtils::getIsPopupNotify();
CCFileUtils::setIsPopupNotify(false);
tex = CCTextureCache::sharedTextureCache()->addImage(fullpath.c_str());
// reset the value of UIImage notify
CCFileUtils::setIsPopupNotify(bNotify);
// add by m.ding
if (tex) {
CCTextureCache::sharedTextureCache()->removeTexture(tex);
tex = NULL;
}
}