[Orxonox-commit 5751] r10411 - in code/branches/core7/src: libraries/tools modules/weapons/projectiles

landauf at orxonox.net landauf at orxonox.net
Sat May 2 17:09:15 CEST 2015


Author: landauf
Date: 2015-05-02 17:09:15 +0200 (Sat, 02 May 2015)
New Revision: 10411

Modified:
   code/branches/core7/src/libraries/tools/ParticleInterface.cc
   code/branches/core7/src/libraries/tools/ParticleInterface.h
   code/branches/core7/src/modules/weapons/projectiles/ParticleProjectile.cc
Log:
removed unnecessary macro + static variable

Modified: code/branches/core7/src/libraries/tools/ParticleInterface.cc
===================================================================
--- code/branches/core7/src/libraries/tools/ParticleInterface.cc	2015-05-02 14:47:21 UTC (rev 10410)
+++ code/branches/core7/src/libraries/tools/ParticleInterface.cc	2015-05-02 15:09:15 UTC (rev 10411)
@@ -48,7 +48,6 @@
 namespace orxonox
 {
     unsigned int ParticleInterface::counter_s = 0;
-    ParticleInterface* ParticleInterface::currentParticleInterface_s = 0;
 
     RegisterAbstractClass(ParticleInterface).inheritsFrom<TimeFactorListener>();
 

Modified: code/branches/core7/src/libraries/tools/ParticleInterface.h
===================================================================
--- code/branches/core7/src/libraries/tools/ParticleInterface.h	2015-05-02 14:47:21 UTC (rev 10410)
+++ code/branches/core7/src/libraries/tools/ParticleInterface.h	2015-05-02 15:09:15 UTC (rev 10411)
@@ -34,11 +34,6 @@
 #include "util/OgreForwardRefs.h"
 #include "tools/interfaces/TimeFactorListener.h"
 
-#define getAllEmitters() \
-  storeThisAsCurrentParticleInterface(); \
-  for (unsigned int i = 0; i < ParticleInterface::getCurrentParticleInterface()->getNumEmitters(); ++i) \
-    ParticleInterface::getCurrentParticleInterface()->getEmitter(i)
-
 namespace orxonox
 {
     class _ToolsExport ParticleInterface : public TimeFactorListener
@@ -79,11 +74,6 @@
 
             void setDetailLevel(unsigned int level);
 
-            inline void storeThisAsCurrentParticleInterface()
-                { ParticleInterface::currentParticleInterface_s = this; }
-            inline static ParticleInterface* getCurrentParticleInterface()
-                { return ParticleInterface::currentParticleInterface_s; }
-
         protected:
             virtual void changedTimeFactor(float factor_new, float factor_old);
 
@@ -102,7 +92,6 @@
             // config values
             unsigned int              globalDetailLevel_; //!< Global maximum detail level of particle effects (0: off, 1: low, 2: normal, 3: high)
 
-            static ParticleInterface* currentParticleInterface_s;
             static unsigned int       counter_s;
     };
 }

Modified: code/branches/core7/src/modules/weapons/projectiles/ParticleProjectile.cc
===================================================================
--- code/branches/core7/src/modules/weapons/projectiles/ParticleProjectile.cc	2015-05-02 14:47:21 UTC (rev 10410)
+++ code/branches/core7/src/modules/weapons/projectiles/ParticleProjectile.cc	2015-05-02 15:09:15 UTC (rev 10411)
@@ -53,7 +53,8 @@
             this->attachOgreObject(this->particles_->getParticleSystem());
             this->particles_->setKeepParticlesInLocalSpace(0);
 
-            this->particles_->getAllEmitters()->setDirection(-WorldEntity::FRONT);
+            for (unsigned int i = 0; i < this->particles_->getNumEmitters(); ++i)
+                this->particles_->getEmitter(i)->setDirection(-WorldEntity::FRONT);
         }
         else
             this->particles_ = 0;




More information about the Orxonox-commit mailing list