예제 #1
0
	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;
}
예제 #3
0
void ModifierGroup::clear()
{
    for (std::vector<Modifier*>::iterator it = modifiers.begin(); it != modifiers.end(); ++it)
        decrementChildReference(*it);

    modifiers.clear();
}
예제 #4
0
	void Modifier::setZone(Zone* zone,bool full)
	{
		decrementChildReference(this->zone);
		incrementChildReference(zone);

		this->zone = zone;
		this->full = full;
	}
예제 #5
0
	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);
		}
	}
예제 #6
0
파일: SPK_System.cpp 프로젝트: 4ian/GD
	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);
		}
	}
예제 #7
0
void Group::removeEmitter(Emitter* emitter)
{
	int FoundIdx = emitters.indexOf(emitter);
	if( FoundIdx != -1 )
	{
		decrementChildReference(emitter);
		emitters.remove(FoundIdx);
	}
}
예제 #8
0
	void Emitter::setZone(Zone* zone,bool full)
	{
		decrementChildReference(this->zone);
		incrementChildReference(zone);

		if (zone == NULL)
			zone = &getDefaultZone();

		this->zone = zone;
		this->full = full;
	}
예제 #9
0
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;
}
예제 #10
0
	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);
		}
	}
예제 #11
0
	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;
	}
예제 #12
0
void Group::removeModifier(Modifier* modifier)
{
	int FoundIdx = modifiers.indexOf(modifier);
	if( FoundIdx != -1 )
	{
		decrementChildReference(modifier);

		if(bufferManagement)
			modifier->destroyBuffers(*this);

		modifiers.remove(FoundIdx);
	}
}
예제 #13
0
	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);
	}