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.

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.