I'd like to be able to delete Ogre::ParticleSystem "Emitter"s by pointer. At the moment the only function available is to delete via an index (which you can't actually get from the emitter anyway!) http://www.ogre3d.org/docs/api/html/cla ... ystem.html
I'd like to submit this patch which overloads 'Ogre::ParticleSystem::removeEmitter()' function to take a pointer to an emitter, it's a very simple change.
ParticleSystem.h
Code: Select all
/** Removes an emitter from the system.
@remarks
Drops the emitter from this system.
@param
emitter Pointer to a particle emitter.
*/
void removeEmitter(ParticleEmitter *emitter);
Code: Select all
void ParticleSystem::removeEmitter(ParticleEmitter* emitter)
{
mEmitters.erase(
remove(mEmitters.begin(), mEmitters.end(), emitter), mEmitters.end());
ParticleSystemManager::getSingleton()._destroyEmitter(emitter);
}
I've attached the patch files to this post, I've tested them and they work fine.
Thoughts?