[Orxonox-commit 5973] r10632 - code/trunk/src/modules/jump

fvultier at orxonox.net fvultier at orxonox.net
Sat Oct 10 19:55:21 CEST 2015


Author: fvultier
Date: 2015-10-10 19:55:21 +0200 (Sat, 10 Oct 2015)
New Revision: 10632

Modified:
   code/trunk/src/modules/jump/JumpPlatform.cc
   code/trunk/src/modules/jump/JumpPlatform.h
Log:
Removed useless code (artifacts from copy-paste) in the Jump minigame.

Modified: code/trunk/src/modules/jump/JumpPlatform.cc
===================================================================
--- code/trunk/src/modules/jump/JumpPlatform.cc	2015-10-10 16:38:44 UTC (rev 10631)
+++ code/trunk/src/modules/jump/JumpPlatform.cc	2015-10-10 17:55:21 UTC (rev 10632)
@@ -53,23 +53,6 @@
 
         figure_ = 0;
 
-        //initialize sound
-        if (GameMode::isMaster())
-        {
-            defScoreSound_ = new WorldSound(this->getContext());
-            defScoreSound_->setVolume(1.0f);
-            defBatSound_ = new WorldSound(this->getContext());
-            defBatSound_->setVolume(0.4f);
-            defBoundarySound_ = new WorldSound(this->getContext());
-            defBoundarySound_->setVolume(0.5f);
-        }
-        else
-        {
-            defScoreSound_ = 0;
-            defBatSound_ = 0;
-            defBoundarySound_ = 0;
-        }
-
         setPosition(Vector3(0,0,0));
         setVelocity(Vector3(0,0,0));
         setAcceleration(Vector3(0,0,0));
@@ -84,17 +67,13 @@
 
     }
 
-    //xml port for loading sounds
+    //xml port for loading height and width of the platform
     void JumpPlatform::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SUPER(JumpPlatform, XMLPort, xmlelement, mode);
 
         XMLPortParam(JumpPlatform, "height", setHeight, getHeight, xmlelement, mode);
         XMLPortParam(JumpPlatform, "width", setWidth, getWidth, xmlelement, mode);
-
-        XMLPortParam(JumpPlatform, "defScoreSound",  setDefScoreSound,  getDefScoreSound,  xmlelement, mode);
-        XMLPortParam(JumpPlatform, "defBatSound",  setDefBatSound,  getDefBatSound,  xmlelement, mode);
-        XMLPortParam(JumpPlatform, "defBoundarySound",  setDefBoundarySound,  getDefBoundarySound,  xmlelement, mode);
     }
 
     /**
@@ -133,55 +112,4 @@
     {
 
     }
-
-    void JumpPlatform::setDefScoreSound(const std::string &jumpSound)
-    {
-        if( defScoreSound_ )
-            defScoreSound_->setSource(jumpSound);
-        else
-            assert(0); // This should never happen, because soundpointer is only available on master
-    }
-
-    const std::string& JumpPlatform::getDefScoreSound()
-    {
-        if( defScoreSound_ )
-            return defScoreSound_->getSource();
-        else
-            assert(0);
-        return BLANKSTRING;
-    }
-
-    void JumpPlatform::setDefBatSound(const std::string &jumpSound)
-    {
-        if( defBatSound_ )
-            defBatSound_->setSource(jumpSound);
-        else
-            assert(0); // This should never happen, because soundpointer is only available on master
-    }
-
-    const std::string& JumpPlatform::getDefBatSound()
-    {
-        if( defBatSound_ )
-            return defBatSound_->getSource();
-        else
-            assert(0);
-        return BLANKSTRING;
-    }
-
-    void JumpPlatform::setDefBoundarySound(const std::string &jumpSound)
-    {
-        if( defBoundarySound_ )
-            defBoundarySound_->setSource(jumpSound);
-        else
-            assert(0); // This should never happen, because soundpointer is only available on master
-    }
-
-    const std::string& JumpPlatform::getDefBoundarySound()
-    {
-        if( defBoundarySound_ )
-            return defBoundarySound_->getSource();
-        else
-            assert(0);
-        return BLANKSTRING;
-    }
 }

Modified: code/trunk/src/modules/jump/JumpPlatform.h
===================================================================
--- code/trunk/src/modules/jump/JumpPlatform.h	2015-10-10 16:38:44 UTC (rev 10631)
+++ code/trunk/src/modules/jump/JumpPlatform.h	2015-10-10 17:55:21 UTC (rev 10632)
@@ -51,13 +51,6 @@
             void setFigure(JumpFigure* newFigure);
             virtual void touchFigure();
 
-            void setDefScoreSound(const std::string& engineSound);
-            const std::string& getDefScoreSound();
-            void setDefBatSound(const std::string& engineSound);
-            const std::string& getDefBatSound();
-            void setDefBoundarySound(const std::string& engineSound);
-            const std::string& getDefBoundarySound();
-
             void setWidth(const float width)
                 { this->width_ = width; }
             float getWidth() const
@@ -71,9 +64,6 @@
             float width_;
             float height_;
             WeakPtr<JumpFigure> figure_;
-            WorldSound* defScoreSound_;
-            WorldSound* defBatSound_;
-            WorldSound* defBoundarySound_;
     };
 }
 




More information about the Orxonox-commit mailing list