//------------------------------------------------------------------------------------
// irr::scene::IParticleEmitter wrappers
//------------------------------------------------------------------------------------

extern "C" 
{
	array<SParticle>* IrrScene_IParticleEmitter_emitt(IParticleEmitter* pe,u32 now,u32 timeSinceLastCall)
	{
		if (pe) {
			SParticle* outArr;
			int count=0;
			count=pe->emitt(now,timeSinceLastCall,outArr);
			array<SParticle>* retval=new array<SParticle>();
			retval->set_pointer(outArr,count);
			return retval;
		}
		else return 0;
	}

	s32 IrrScene_IParticleEmitter_getType(IParticleEmitter* pe)
	{
		if (pe)
			return (s32)pe->getType();
		else return -1; 
	}
		
	bool IrrScene_IParticleEmitter_drop(IParticleEmitter* unk)
	{
		if (unk)
			return unk->drop();
		else return 0;
	}
	
	const c8* IrrScene_IParticleEmitter_getDebugName(IParticleEmitter* unk)
	{
		if (unk)
			return unk->getDebugName();
		else return "";
	}
	
	void IrrScene_IParticleEmitter_grab(IParticleEmitter* unk)
	{
		if (unk)
			unk->grab();
	}

	void IrrScene_IParticleEmitter_setDirection( IParticleEmitter* pe, vector3df* newDirection )
	{
		if (pe) {
			pe->setDirection(*newDirection);
		}
	}

	void IrrScene_IParticleEmitter_setMinParticlesPerSecond( IParticleEmitter* pe, u32 minPPS )
	{
		if (pe) {
			pe->setMinParticlesPerSecond(minPPS);
		}
	}

	void IrrScene_IParticleEmitter_setMaxParticlesPerSecond( IParticleEmitter* pe, u32 maxPPS )
	{
		if (pe) {
			pe->setMaxParticlesPerSecond(maxPPS);
		}
	}

	void IrrScene_IParticleEmitter_setMinStartColor( IParticleEmitter* pe, SColor* color )
	{
		if (pe) {
			pe->setMinStartColor(*color);
		}
	}

	void IrrScene_IParticleEmitter_setMaxStartColor( IParticleEmitter* pe, SColor* color )
	{
		if (pe) {
			pe->setMaxStartColor(*color);
		}
	}

	// must delete
	vector3df* IrrScene_IParticleEmitter_getDirection(IParticleEmitter* pe)
	{
		if (pe) {
			return new vector3df(pe->getDirection());
		} else return 0;
	}

	u32 IrrScene_IParticleEmitter_getMinParticlesPerSecond(IParticleEmitter* pe)
	{
		if (pe) {
			return pe->getMinParticlesPerSecond();
		} else return 0;
	}

	u32 IrrScene_IParticleEmitter_getMaxParticlesPerSecond(IParticleEmitter* pe)
	{
		if (pe) {
			return pe->getMaxParticlesPerSecond();
		} else return 0;
	}

	// must delete
	SColor* IrrScene_IParticleEmitter_getMinStartColor(IParticleEmitter* pe)
	{
		if (pe) {
			return new SColor(pe->getMinStartColor());
		} else return 0;
	}

	// must delete
	SColor* IrrScene_IParticleEmitter_getMaxStartColor(IParticleEmitter* pe)
	{
		if (pe) {
			return new SColor(pe->getMaxStartColor());
		} else return 0;
	}
	
	// must delete
	dimension2df* IrrScene_IParticleEmitter_getMaxStartSize(IParticleEmitter* pe)
	{
		if (pe)
			return new dimension2df(pe->getMaxStartSize());
		else return 0;
	}

	// must delete
	dimension2df* IrrScene_IParticleEmitter_getMinStartSize(IParticleEmitter* pe)
	{
		if (pe)
			return new dimension2df(pe->getMinStartSize());
		else return 0;
	}

	void IrrScene_IParticleEmitter_setMaxStartSize(IParticleEmitter* pe, const core::dimension2df* size )
	{
		if (pe)
			pe->setMaxStartSize(*size);
	}

	void IrrScene_IParticleEmitter_setMinStartSize(IParticleEmitter* pe, const core::dimension2df* size )
	{
		if (pe)
			pe->setMinStartSize(*size);
	}
	
}

