Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 10, 2015, 7:55:21 PM (9 years ago)
Author:
fvultier
Message:

Removed useless code (artifacts from copy-paste) in the Jump minigame.

Location:
code/trunk/src/modules/jump
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/jump/JumpPlatform.cc

    r10624 r10632  
    5454        figure_ = 0;
    5555
    56         //initialize sound
    57         if (GameMode::isMaster())
    58         {
    59             defScoreSound_ = new WorldSound(this->getContext());
    60             defScoreSound_->setVolume(1.0f);
    61             defBatSound_ = new WorldSound(this->getContext());
    62             defBatSound_->setVolume(0.4f);
    63             defBoundarySound_ = new WorldSound(this->getContext());
    64             defBoundarySound_->setVolume(0.5f);
    65         }
    66         else
    67         {
    68             defScoreSound_ = 0;
    69             defBatSound_ = 0;
    70             defBoundarySound_ = 0;
    71         }
    72 
    7356        setPosition(Vector3(0,0,0));
    7457        setVelocity(Vector3(0,0,0));
     
    8568    }
    8669
    87     //xml port for loading sounds
     70    //xml port for loading height and width of the platform
    8871    void JumpPlatform::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    8972    {
     
    9275        XMLPortParam(JumpPlatform, "height", setHeight, getHeight, xmlelement, mode);
    9376        XMLPortParam(JumpPlatform, "width", setWidth, getWidth, xmlelement, mode);
    94 
    95         XMLPortParam(JumpPlatform, "defScoreSound",  setDefScoreSound,  getDefScoreSound,  xmlelement, mode);
    96         XMLPortParam(JumpPlatform, "defBatSound",  setDefBatSound,  getDefBatSound,  xmlelement, mode);
    97         XMLPortParam(JumpPlatform, "defBoundarySound",  setDefBoundarySound,  getDefBoundarySound,  xmlelement, mode);
    9877    }
    9978
     
    134113
    135114    }
    136 
    137     void JumpPlatform::setDefScoreSound(const std::string &jumpSound)
    138     {
    139         if( defScoreSound_ )
    140             defScoreSound_->setSource(jumpSound);
    141         else
    142             assert(0); // This should never happen, because soundpointer is only available on master
    143     }
    144 
    145     const std::string& JumpPlatform::getDefScoreSound()
    146     {
    147         if( defScoreSound_ )
    148             return defScoreSound_->getSource();
    149         else
    150             assert(0);
    151         return BLANKSTRING;
    152     }
    153 
    154     void JumpPlatform::setDefBatSound(const std::string &jumpSound)
    155     {
    156         if( defBatSound_ )
    157             defBatSound_->setSource(jumpSound);
    158         else
    159             assert(0); // This should never happen, because soundpointer is only available on master
    160     }
    161 
    162     const std::string& JumpPlatform::getDefBatSound()
    163     {
    164         if( defBatSound_ )
    165             return defBatSound_->getSource();
    166         else
    167             assert(0);
    168         return BLANKSTRING;
    169     }
    170 
    171     void JumpPlatform::setDefBoundarySound(const std::string &jumpSound)
    172     {
    173         if( defBoundarySound_ )
    174             defBoundarySound_->setSource(jumpSound);
    175         else
    176             assert(0); // This should never happen, because soundpointer is only available on master
    177     }
    178 
    179     const std::string& JumpPlatform::getDefBoundarySound()
    180     {
    181         if( defBoundarySound_ )
    182             return defBoundarySound_->getSource();
    183         else
    184             assert(0);
    185         return BLANKSTRING;
    186     }
    187115}
  • code/trunk/src/modules/jump/JumpPlatform.h

    r10624 r10632  
    5252            virtual void touchFigure();
    5353
    54             void setDefScoreSound(const std::string& engineSound);
    55             const std::string& getDefScoreSound();
    56             void setDefBatSound(const std::string& engineSound);
    57             const std::string& getDefBatSound();
    58             void setDefBoundarySound(const std::string& engineSound);
    59             const std::string& getDefBoundarySound();
    60 
    6154            void setWidth(const float width)
    6255                { this->width_ = width; }
     
    7265            float height_;
    7366            WeakPtr<JumpFigure> figure_;
    74             WorldSound* defScoreSound_;
    75             WorldSound* defBatSound_;
    76             WorldSound* defBoundarySound_;
    7767    };
    7868}
Note: See TracChangeset for help on using the changeset viewer.