void Group::setModel(Model* newmodel) { if(!newmodel) newmodel = &getDefaultModel(); if(model == newmodel) return; // empty and change model empty(); decrementChildReference(model); incrementChildReference(newmodel); model = newmodel; // recreate data delete[] particleData; delete[] particleCurrentParams; delete[] particleExtendedParams; particleData = new Particle::ParticleData[pool.getNbReserved()]; particleCurrentParams = new float[pool.getNbReserved() * model->getSizeOfParticleCurrentArray()]; particleExtendedParams = new float[pool.getNbReserved() * model->getSizeOfParticleExtendedArray()]; pool.clear(); // Destroys all the buffers destroyAllBuffers(); }
void NormalEmitter::setNormalZone(Zone* zone) { decrementChildReference(normalZone); incrementChildReference(zone); normalZone = zone; }
void ModifierGroup::clear() { for (std::vector<Modifier*>::iterator it = modifiers.begin(); it != modifiers.end(); ++it) decrementChildReference(*it); modifiers.clear(); }
void Modifier::setZone(Zone* zone,bool full) { decrementChildReference(this->zone); incrementChildReference(zone); this->zone = zone; this->full = full; }
void Group::removeEmitter(Emitter* emitter) { std::vector<Emitter*>::iterator it = std::find(emitters.begin(),emitters.end(),emitter); if (it != emitters.end()) { decrementChildReference(emitter); emitters.erase(it); } }
void System::removeGroup(Group* group) { std::vector<Group*>::iterator it = std::find(groups.begin(),groups.end(),group); if (it != groups.end()) { decrementChildReference(group); groups.erase(it); } }
void Group::removeEmitter(Emitter* emitter) { int FoundIdx = emitters.indexOf(emitter); if( FoundIdx != -1 ) { decrementChildReference(emitter); emitters.remove(FoundIdx); } }
void Emitter::setZone(Zone* zone,bool full) { decrementChildReference(this->zone); incrementChildReference(zone); if (zone == NULL) zone = &getDefaultZone(); this->zone = zone; this->full = full; }
bool ModifierGroup::removeModifier(const Modifier* modifier) { std::vector<Modifier*>::iterator it = std::find<std::vector<Modifier*>::iterator,const Modifier*>(modifiers.begin(),modifiers.end(),modifier); if (it != modifiers.end()) { decrementChildReference(*it); modifiers.erase(it); return true; } return false; }
void Group::removeModifier(Modifier* modifier) { std::vector<Modifier*>::iterator it = std::find(modifiers.begin(),modifiers.end(),modifier); if (it != modifiers.end()) { decrementChildReference(modifier); if (bufferManagement) (*it)->createBuffers(*this); modifiers.erase(it); } }
void Group::setRenderer(Renderer* renderer) { decrementChildReference(this->renderer); incrementChildReference(renderer); if ((bufferManagement)&&(renderer != this->renderer)) { if (this->renderer != NULL) this->renderer->destroyBuffers(*this); if (renderer != NULL) renderer->createBuffers(*this); } this->renderer = renderer; }
void Group::removeModifier(Modifier* modifier) { int FoundIdx = modifiers.indexOf(modifier); if( FoundIdx != -1 ) { decrementChildReference(modifier); if(bufferManagement) modifier->destroyBuffers(*this); modifiers.remove(FoundIdx); } }
void ZoneUnion::removeZone(Zone* zone) { bool found = false; for (size_t t = 0; t < Zones.size();) { if(Zones[t] == zone) { Zones.erase(Zones.begin()+t); found = true; } else t++; } if(found) decrementChildReference(zone); }