Improve ParticleSystem initWithDictionary to reduce warnings

Hi,

I’m using particle plist files generated by ParticleDesigner.
Those files have the texture data embedded in the plist (using the “textureImageData” key), which is perfectly supported by cocos2d-x. But ParticleDesigner also adds the “textureFileName” key in the plist (pointing to an non-existant file, in case the texture is embedded).

This causes a warning from the FileUtils::fullPathForFilename function, since it tries to load a texture from a file that do not exists, and it does this for each searchPath configured in the game, which is annoying in debug (and is time consuming in release).

What I suggest is to slightly change the ParticleSystem::initWithDictionary method to first search for the embedded texture key (“textureImageData”) and then only, if it is not found, to search for a file on the disk.

Thanks for reading,
Chris

1 Like

Hello @dakiki !
You could create a query to update in github, if you have particular code, of course.

You mean a pull request?
Never done that, is that simple?
(google is full of crap sometimes, do you have a good tut?)

Yes, I meant it. I’m sorry, my English is bad.

Unfortunately I do not have links to a good tutorial. I just only hope someday to contribute to the development of the cocos.
Maybe someone from the development team will be able to help with githab?

@dakiki - check out the accepted answer to the following SO question:

http://stackoverflow.com/questions/14680711/how-to-do-a-github-pull-request

NOTE: the accepted answer is not the top answer, as it has less votes… but has a good step-by-step walk through