diff src/modules/graphics/opengl/ParticleSystem.cpp @ 1408:107d80a59bca

Added ParticleSystem:emit(num) (issue #577)
author Alex Szpakowski <slime73@gmail.com>
date Wed, 27 Mar 2013 01:09:53 -0300
parents f0795108d4c0
children e952fc68069d
line wrap: on
line diff
--- a/src/modules/graphics/opengl/ParticleSystem.cpp	Tue Mar 26 23:41:46 2013 -0300
+++ b/src/modules/graphics/opengl/ParticleSystem.cpp	Wed Mar 27 01:09:53 2013 -0300
@@ -478,6 +478,20 @@
 	emitCounter = 0;
 }
 
+void ParticleSystem::emit(int num)
+{
+	if (!active)
+		return;
+
+	for (int i = 0; i < num; i++)
+	{
+		if (isFull())
+			return;
+
+		add();
+	}
+}
+
 bool ParticleSystem::isActive() const
 {
 	return active;